Closed mgaber2024 closed 2 months ago
Two ways to solve this problem https://github.com/mcamara/laravel-localization/issues/899#issuecomment-2096959567
class AppServiceProvider extends ServiceProvider
{
use \Mcamara\LaravelLocalization\Traits\LoadsTranslatedCachedRoutes;
public function boot(): void
{
RouteServiceProvider::loadCachedRoutesUsing(fn() => $this->loadCachedRoutes());
...
}
(or)
https://github.com/mcamara/laravel-localization?tab=readme-ov-file#caching-routes
<?php
class RouteServiceProvider extends ServiceProvider
{
use \Mcamara\LaravelLocalization\Traits\LoadsTranslatedCachedRoutes;
RouteServiceProvider::loadCachedRoutesUsing(fn() => $this->loadCachedRoutes());
This solution is working.
@tringuyenduc2903 Thank You ☺
Describe the bug I got 404 after I used php artisan route:trans:cache command and added
use \Mcamara\LaravelLocalization\Traits\LoadsTranslatedCachedRoutes; in route service provider as described in the docs
Expected behavior I should can access the app routes normally
More info:
Route::groups
'localeSessionRedirect', 'localizationRedirect', 'localeViewPath'Copy of the config file
`