Skip to content

RoesWibowo/Laravel-4-Modular-Approach

Repository files navigation

Laravel 4 Modular (HMVC) Approach

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.

How it works:

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().

How to install:

  1. Setup mysql database in: app/config/database.php.
  2. Run: composer install
  3. Migrate from module migration: php artisan migrate --path="app/modules/user/database/migrations"
  4. Seed from module seeder: php artisan db:seed --class="App\Modules\User\Database\Seeds\UserSeeder"
  5. Access using: http://yourlaravelapp.com/user or http://yourlaravelapp.com/user/index.

FYI:

  1. Install using composer.json with "app/modules" included in classmap.
  2. Once you create modules, register namespace module service provider in: "app/config/app.php".
  3. We can create new migration file with command: php artisan migrate:make ChangeUser --path="app/modules/user/database/migrations"
  4. 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:

About

This is customized laravel 4 in HMVC form. This modules coverage: config, controller, database: migration and seeding, lang, models, views, custom filters, and custom routes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published