Kernel.php in V3 t oregister middleware

I'm trying to use https://github.com/mcamara/laravel-localization in filamentphp. At some point, i need t oregeister the middleware in the Kernel.php file but there is no Kernel.php file in v3 i need this middleware outside of the panel, in my frontend. Do i need to override the Kernel.php cby creating a new file in App\Http or there is another way to register middleware? https://github.com/mcamara/laravel-localization#register-middleware You may register the package middleware in the app/Http/Kernel.php file: <?php namespace App\Http; use Illuminate\Foundation\Http\Kernel as HttpKernel; class Kernel extends HttpKernel { / * The application's route middleware. * * @var array */ protected $middlewareAliases = [ /** OTHER MIDDLEWARE **/ 'localize' => \Mcamara\LaravelLocalization\Middleware\LaravelLocalizationRoutes::class, 'localizationRedirect' => \Mcamara\LaravelLocalization\Middleware\LaravelLocalizationRedirectFilter::class, 'localeSessionRedirect' => \Mcamara\LaravelLocalization\Middleware\LocaleSessionRedirect::class, 'localeCookieRedirect' => \Mcamara\LaravelLocalization\Middleware\LocaleCookieRedirect::class, 'localeViewPath' => \Mcamara\LaravelLocalization\Middleware\LaravelLocalizationViewPath::class ]; }
GitHub
GitHub - mcamara/laravel-localization: Easy localization for Laravel
Easy localization for Laravel. Contribute to mcamara/laravel-localization development by creating an account on GitHub.
1 Reply
Vp
Vp7mo ago
Filament doesn't have to do anything about Kernel, it's laravel v11 changes. check on laravel docs https://laravel.com/docs/11.x/middleware#registering-middleware

Did you find this page helpful?