Aspile Inc
Aspile Inc

Reputation: 119

How to change the Modules "Modules" folder name?

I am using Laravel Modules

https://github.com/nWidart/laravel-modules

enter image description here

This is the Folder Structure with Modules.

Is there any way to change it? Like I want to create

Admin\Category

Means my Modules folder name will be Admin

"autoload": {
   "psr-4": {
      "App\": "app/",
      "Modules\": "Admin/",
      "Database\Factories\": "database/factories/",
      "Database\Seeders\": "database/seeders/"
   }
},

I tried with this but not working!

Thanks

Upvotes: 0

Views: 1160

Answers (1)

anas omush
anas omush

Reputation: 332

Based on documentation of package yes you can.

First step run this command

php artisan vendor:publish --provider="Nwidart\Modules\LaravelModulesServiceProvider"

Second Step in Config/laravel-modules.php will find ["Modules path","Modules assets path","Default Namespace"] you can customize them

Last Step in composer.json

"autoload": {
   "psr-4": {
      "App\": "app/",
      "Admin\": "Admin/",
      "Database\Factories\": "database/factories/",
      "Database\Seeders\": "database/seeders/"
   }
},

then run composer dump-autoload

Upvotes: 1

Related Questions