devhridoy/l6modular

Modular pattern generator for Laravel 6.It is orginaly created by ArtemSchander, i was just implements for laravel 6

Downloads

73

Stars

0

Version

L6Modular Modified by Gm Omar Farook Hridoy

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

Attention

"This package originally created by artem-schander", I just modified some code and implement for Laravel 6. Thanks.

Dcumentation

  • Installation
  • Getting started
  • Usage

Istallation

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

Run the following command from your projects root

composer require devhridoy/l6modular

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

Service Provider

Devhridoy\L6modular\ModuleServiceProvider::class

Setting Started

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

Since version 1.3.0 you can generate modules named with more than one word, like foo-bar.

This is how the generated module would look like:

laravel-project/
    app/
    └── Modules/
        └── FooBar/
            ├── Controllers/
            │   └── FooBarController.php
            ├── Models/
            │   └── FooBar.php
            ├── Views/
            │   └── index.blade.php
            ├── Translations/
            │   └── en/
            │       └── example.php
            ├── routes
            │   ├── api.php
            │   └── web.php
            └── helper.php

Usage

The generated RESTful Resource Controller and the corresponding routes/web.php make it easy to dive in. In my example you would see the output from the Modules/FooBar/Views/index.blade.php by opening laravel-project:8000/foo-bar in your browser.

Update 1.0.0 For Laravel 6

You have to follow the upper camel case name convention for the module folder. If you had a Modules/foo folder you have to rename it to Modules/Foo.

Also there are changes in the app/config/modules.php file. Now you have to return an array with the key enable instead of list.

License

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

gmfaruk

Author

gmfaruk