trieunb/modules

A package module of team ans-asia build for dev

dev-master 2018-04-04 03:10 UTC

This package is not auto-updated.

Last update: 2025-06-13 06:41:06 UTC


README

This package gives you the ability to use Laravel 5 with module system. You can simply drop or generate modules with their own controllers, models, views and a routes file into the app/Modules folder and go on working with them.

Documentation

Installation

The best way to install this package is through your terminal via Composer.

Run the following command from your projects root

composer require "trieunb/modules @dev"

Once this operation is complete, simply add the service provider to your project's config/app.php and you're done.

Service Provider

Trieunb\Modules\ModuleServiceProvider::class,

Getting started

The built in Artisan command php artisan make:module name generates a ready to use module in the app/Modules folder and a migration if necessary.

This is how the generated module would look like:

laravel-project/
    app/
    └── Modules/
        └── Demo/
            ├── Controllers/
            │   └── DemoController.php
            ├── Models/
            │   └── Demo.php
            ├── Views/
            │   └── index.blade.php
            └── routes.php
                

Usage

The generated RESTful Resource Controller and the corresponding routes.php make it easy to dive in. In my example you would see the output from the Modules/Demo/Views/index.blade.php when you open laravel-project:8000/demo in your browser.

License

modules is licensed under the terms of the MIT License (See LICENSE file for details).