Laravel-modules: In ProviderRepository.php line 208: Class 'Modules\Modulename\Providers\ModulenameServiceProvider' not found

Created on 25 May 2018  路  8Comments  路  Source: nWidart/laravel-modules

When i run php artisan module:make Modulename, files were created in terminal but actually there is no module and its file. I am using laravel 5.5 and modules ^2.0.

Most helpful comment

did you add the autoloading in composer.json?

All 8 comments

Hello,

Version 2 is not supported anymore. Please update to the latest.
It looks like some files were generated though, otherwise, you wouldn't have this error.

Is there a solution for this? I am using Laravel 5.6 and v3.2 and getting this same error. Thanks!

Not without more information no.

@nWidart
I installed the package and published the configuration file.
I ran the the artisan command to create a "Meal" module:
php artisan module:make Meal

Files are created and it says Module [Meal] created successfully.

I then run composer dump-autoload and get the following error:
Generating optimized autoload files

Illuminate\FoundationComposerScripts::postAutoloadDump
@php artisan package:discover

In ProviderRepository.php line 208:

Class 'Modules\Meal\Providers\MealServiceProvider' not found

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

At this point, I am no longer able to run any artisan commands as I get the following error:
In ProviderRepository.php line 208:

Class 'Modules\Meal\Providers\MealServiceProvider' not found

Hope this helps! Thanks!

did you add the autoloading in composer.json?

@nWidart, that was it! I didn't have it in the main composer.json file. Thanks!

@nWidart how?

How what?
The autoloading section is mentioned here: https://github.com/nWidart/laravel-modules#autoloading

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sujit-baniya picture sujit-baniya  路  4Comments

ojasseh picture ojasseh  路  3Comments

pawlox picture pawlox  路  4Comments

dang-tien picture dang-tien  路  3Comments

firebed picture firebed  路  3Comments