I am developing a package for Laravel 5, but if the user changes the default namespace for the application, the package on command php artisan app:name Testwill not work properly. the package should know that the application namespace is working correctly.
Based on my understanding, Laravel 5 does not provide the application namespace in any of its main classes
So, I decided either to get this namespace from the file composer.json
"psr-4": {
"AppNamespace\\": "app/"
}
or ask the user to provide the application namespace as a configuration file.
Question: please let me know if my presumption about Laravel does not provide that it is correct, and if it is correct, tell me which way is the best way to get this namespaceor if you have a better offer?
source
share