Open wedi opened 3 years ago
Thanks for report, will check it
Laravel reads the vendor/composer/installed.json
. You could check the "extra": { "laravel": { "providers": [
of all packages listed there.
Keep in mind that the root composer.json
could also contain excludes for packages from autoloading:
"extra": {
"laravel": {
"dont-discover": [
which are then not autoload anymore.
:)
Is it somehow possible to support Laravels autodicovery feature?
I tried to dig into Laravel to find the relevant code but I only found the place where the extra gets loaded, not where it's actually stored.
Php version:
8.0 (but doesn't really matter)
Os:
macOS / Ubunutu / Alpine
Composer packages with detection troubles:
All Laravel autodiscovered packages, e.g. https://github.com/spatie/laravel-json-api-paginate
Which type of autoload it uses?
Autodiscovery via the package's
composer.json
extra
.See: https://laravelpackage.com/03-service-providers.html#autoloading
composer.json
of the package that is not detected:Code example of package classes usage that not detected:
The methods are magically injected, you call the package methods on your own models without any
use
.See: https://github.com/spatie/laravel-json-api-paginate#usage