-
Notifications
You must be signed in to change notification settings - Fork 0
πͺ Creating your first module
JoΓ£o Ferreira edited this page Jun 30, 2024
·
2 revisions
To create the module, just do:
php artisan modulify:make your_module_nameOr, if you're using sail:
sail artisan modulify:make your_module_nameLet's say we want to create the Users module for our laravel app, then we would do this:
php artisan modulify:make UsersIt will automatically create a module called Users in the App\Modules\ directory with the following structure:
| Path | Meaning |
|---|---|
App\Modules\Database |
Everything database related |
App\Modules\Database\Migrations |
Module migrations |
App\Modules\Http\Controllers |
Module controllers |
App\Modules\Models |
Module models |
App\Modules\Routes |
Module routes |
App\Modules\Providers |
Module providers, including the default service provider |
App\Modules\Resources\views |
Module views |
This will automatically register the module in laravel's providers (bootstrap\providers.php) file, if you delete the module manually be sure to remove it from there too!
Modulify β¨
Wiki β’ Quick start β’ Creating your first module β’ Packagist