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.
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
Most helpful comment
did you add the autoloading in composer.json?