Class "Modules\Admin\Providers\AdminServiceProvider" not found
ksaif121786 opened this issue · comments
showing me this Class "Modules\Admin\Providers\AdminServiceProvider" not found and composer dump-autoload not working
https://github.com/nWidart/laravel-modules?tab=readme-ov-file#autoloading
try to update this part, i successful solve this issue on my latest pull.
I have encountered the same situation with laravel 11. Have you resolved it?
my step:
1.laravel new website (v11) & artisan migrate
2.composer require nwidart/laravel-modules & vendor:publish
3.update extra in composer.json
4.composer dump-autoload
5.php artisan module:make Blog
then:
Class "Modules\Blog\Providers\BlogServiceProvider" not found
Can you share a screenshot of your module's composer.json
, module.json
and the provider class?
Can you share a screenshot of your module's
composer.json
,module.json
and the provider class?
It is currently running normally, it is my own problem. opcache setting error.
thanks.
Lastly, try run composer dump-autoload
@solomon-ochepa i ran composer dump-autoload
modules composer :
{
"name": "nwidart/user",
"description": "",
"authors": [
{
"name": "Nicolas Widart",
"email": "n.widart@gmail.com"
}
],
"extra": {
"laravel": {
"providers": [],
"aliases": {
}
}
},
"autoload": {
"psr-4": {
"Modules\\User\\": "app/",
"Modules\\User\\Database\\Factories\\": "database/factories/",
"Modules\\User\\Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Modules\\User\\Tests\\": "tests/"
}
}
}
module.json:
{
"name": "User",
"alias": "user",
"description": "",
"keywords": [],
"priority": 0,
"providers": [
"Modules\\User\\Providers\\UserServiceProvider"
],
"files": []
}
i even added psr-4 to composer to make sure and ran it all again.
by the way this is out of the box and according to documentation. didn't change anything yet
Could you remove the addition at line 30 from the module's composer.json
(image above)?
Please ensure the main composer.json
doesn't include the modules in its autoload.psr-4 section.
If the problem persists, please feel free to reach out for direct support. To assist you effectively, I would need limited access to your code.
WhatsApp: https://wa.me/2348162682618,
Telegram: https://t.me/solomon_ochepa,
Email: solomonochepa@gmail.com
same error for me