This is customized Laravel 4.2 in HMVC pattern. This modules coverage:
- config,
- controller,
- database: migration and seeding,
- lang,
- models,
- views,
- custom filters, and
- custom routes.
We're create module service provider that extends Illuminate\Support\ServiceProvider
abstract class and definitely we can easily register new module (package) using method package()
.
- Setup mysql database in:
app/config/database.php
. - Run:
composer install
- Migrate from module migration:
php artisan migrate --path="app/modules/user/database/migrations"
- Seed from module seeder:
php artisan db:seed --class="App\Modules\User\Database\Seeds\UserSeeder"
- Access using: http://yourlaravelapp.com/user or http://yourlaravelapp.com/user/index.
- Install using composer.json with
"app/modules"
included in classmap. - Once you create modules, register namespace module service provider in:
"app/config/app.php"
. - We can create new migration file with command:
php artisan migrate:make ChangeUser --path="app/modules/user/database/migrations"
- Unfortunately, we can't re-run migration using command:
migrate:refresh
,migrate:reset
,migrate:rollback
.
If you have some ideas, fork this repo. Don't forget to star this repo if useful. Thank you.
Roes Wibowo, http://roes-wibowo.com
Reference: