mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-10-31 05:16:53 +01:00 
			
		
		
		
	 d555c42644
			
		
	
	
		d555c42644
		
			
		
	
	
	
	
		
			
			* update composer.lock * run pint * fix phpstan * update migrations (sqlite `dropForeign`) * fix migrations * Reset these back for now * Alphabetize the rules * run `php artisan filament:upgrade` --------- Co-authored-by: Lance Pioch <git@lance.sh>
		
			
				
	
	
		
			25 lines
		
	
	
		
			545 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			545 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Http\Middleware;
 | |
| 
 | |
| use Illuminate\Http\Request;
 | |
| use Illuminate\Foundation\Application;
 | |
| 
 | |
| class LanguageMiddleware
 | |
| {
 | |
|     /**
 | |
|      * LanguageMiddleware constructor.
 | |
|      */
 | |
|     public function __construct(private Application $app) {}
 | |
| 
 | |
|     /**
 | |
|      * Handle an incoming request and set the user's preferred language.
 | |
|      */
 | |
|     public function handle(Request $request, \Closure $next): mixed
 | |
|     {
 | |
|         $this->app->setLocale($request->user()->language ?? config('app.locale', 'en'));
 | |
| 
 | |
|         return $next($request);
 | |
|     }
 | |
| }
 |