Malki Mohamed
Malki Mohamed

Reputation: 1688

Create Module in laravel 5.3

I want to make a modulare laravel 5.3 application, I try to use nwidart/laravel-modules laravel package from composer, I follow this tutorial laravel modules package and it work, I have my Blog module created and the BlogServiceProvider class too. But when I do php artisan module:use Blog I get this error in composer [Symfony\Component\Debug\Exception\FatalErrorException] Class 'Modules\Vente\Providers\BlogServiceProvider' not found

Upvotes: 0

Views: 3619

Answers (1)

karthik
karthik

Reputation: 56

here is exact solution for this

By default controllers, entities or repositories are not loaded
automatically.
You can autoload your modules using psr-4. For example :


 "autoload": {
    "psr-4": {
        "App\\": "app/",
        "Modules\\": "Modules/"
    }
},

 1) copy the above code and paste it in your Composer.json
 2) then do composer dumpautoload
 3) then do  php artisan module:use blog

Upvotes: 1

Related Questions