-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[11.x] Add ability to override RouteServiceProvider #51249
Conversation
Can you describe instead what you are trying to accomplish as your end goal? |
https://github.com/mcamara/laravel-localization
Based on the current locale of the request, they load the correct cached routes file. So, we have overridden the RouteServiceProvider. |
How about making framework/src/Illuminate/Foundation/Application.php Lines 922 to 925 in a57dca1
This way, one could bind their custom provider on their I would say, as customizing this appears to be very specific, would work better than adding one more parameter to the |
@rodrigopedra I don't understand your point fully. IMO, when anyone open the
will totally understand this provider will be instead of the framework's one |
This is working as intended, right?
Can you provide your overridden method, so we can better understand what you are trying to accomplish? |
i prefer if you can also look at https://github.com/mcamara/laravel-localization?tab=readme-ov-file#caching-routes |
Ok, I get it now. Sorry for the insistence. From that repo's issue tracker, it seems people are finding better results with another package: mcamara/laravel-localization#899 (comment) Maybe, it is worth taking a look in the meanwhile. |
Even if there's another package that can perform the same function, |
I think there is probably a better solution to this. Even something like loadCachedRoutesUsing or some sort of specific solution. |
I need to override
loadCacheRoutes
method insideRouteServiceProvider
as we did before laravel 11 but when i extend the framework RouteServiceProvider and add it inside thebootstrap/providers.php
the framework RouteServiceProvider always run last
i think we are forcing it here #49732