Fix for Laravel 9+: support moved language resource path in Laravel 9#166
Fix for Laravel 9+: support moved language resource path in Laravel 9#166timvisee wants to merge 1 commit intormariuzzo:masterfrom
Conversation
|
Any chance on merging this one? Without it the package doesn't work with default Laravel 9 install. |
|
I have found an alternative way. Create a service provider which references the Mariuzzo\LaravelJsLocalization\LaravelJsLocalizationServiceProvider and overwrite the register method. Then just add your own service provider to config/app.php and it will work with the new path. |
|
@mirkoschmidt how would you reference another service provider form a service provider? Can you share your solution please? |
|
Under app/Providers I created the following provider "LaravelLangJSServiceProvider" with the following content and in config/app.php in the section "providers" i added this at the end
with reference i mean extends. |
|
Any chance of getting this PR merged and another release generated? I just had to go the "override the service provider" route as detailed by @mirkoschmidt to get this to work in Laravel 9. |
|
When this can be merged please? |
|
Today, I'm gonna check that one. I will be careful with the versioning too. |
|
Until this is merged, this command works for default location of lang files in Laravel 9+: |
Laravel 9 moves the language directory, breaking the current implementation.
This change uses
app()->langPath()in Laravel 9+ to dynamically get the language resource path, as recommended per documentation.This should support installations updated from 8 to 9 still using the old path.