Skip to content

add docs to loadCacheRoutes in RouteServiceProvider #902

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 4 commits into from
Jul 24, 2024

Conversation

ahmedabdel3al
Copy link
Contributor

@ahmedabdel3al ahmedabdel3al commented May 6, 2024

laravel/framework#51292 After Laravel added loadCachedRoutesUsing method to RouteServiceProvider

we can use it to fix the problem of loading cached routes in Laravel 11

in AppServiceProvider use put the following in register method

class AppServiceProvider extends ServiceProvider
{  
    use \Mcamara\LaravelLocalization\Traits\LoadsTranslatedCachedRoutes;
    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {
        RouteServiceProvider::loadCachedRoutesUsing(fn() => $this->loadCachedRoutes());
        ...
    }  

@ahmedabdel3al ahmedabdel3al changed the title Adding Support laravel 11 Adding Support laravel 11 to loadcachedroutes May 6, 2024
@ahmedabdel3al ahmedabdel3al changed the title Adding Support laravel 11 to loadcachedroutes Adding Support laravel 11 May 6, 2024
@ahmedabdel3al ahmedabdel3al mentioned this pull request May 6, 2024
@ahmedabdel3al ahmedabdel3al changed the title Adding Support laravel 11 fix loadingCachedRoutes in laravel 11 May 6, 2024
@ahmedabdel3al ahmedabdel3al changed the title fix loadingCachedRoutes in laravel 11 add docs to loadCacheRoutes in RouteServiceProvider May 6, 2024
@kminek
Copy link

kminek commented Jun 20, 2024

@mcamara can we merge this? this is very important for L11 users as there is no RouteServiceProvider anymore in L11 skeleton and the docs are confusing regarding route caching.

@mcamara
Copy link
Owner

mcamara commented Jul 24, 2024

thanks for your commit, I'll merge it!

@mcamara mcamara merged commit 42ea38f into mcamara:master Jul 24, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants