since i upgraded to Laravel 11 , i know there's no kernel.php so i decided to identify the LocalizationMiddleware class at app.php bootstrap
->withMiddleware(function (Middleware $middleware) {
$middleware->append( LocalizationMiddleware::class);
})
but it's still doesn't work so i read more and finally it works with
->withMiddleware(function (Middleware $middleware) {
$middleware->group('web', [
StartSession::class,
ShareErrorsFromSession::class,
LocalizationMiddleware::class,
]);
})
but for filametPhp what happened is not good , when i enter the email and password for the panel nothing happened it's redirect me back to login again , once i removed the middleware it works again , idk why that happen
#Localization Middleware
class LocalizationMiddleware
{
public function handle(Request $request, Closure $next)
{
if (session()->has('locale')) {
$locale = session()->get('locale','en');
app()->setLocale($locale);
}
return $next($request);
}
}