2017 © Pedro Peláez
 

library l5-modular

Modular pattern generator for Laravel 5

image

rayan-tools/l5-modular

Modular pattern generator for Laravel 5

  • Tuesday, January 31, 2017
  • by ahmadhossiny
  • Repository
  • 2 Watchers
  • 6 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 53 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

L5Modular

Laravel Release Source ![Contributor](https://img.shields.io/badge/contributor-Farhan Wazir-blue.svg) License, (*1)

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, translations and a routes file into the app/Modules folder and go on working with them., (*2)

Thanks to zyhn for the "Modular Structure in Laravel 5" tutorial. Well explained and helped a lot., (*3)

Documentation

, (*4)

Installation

The best way to install this package is through your terminal via Composer., (*5)

Add the following line to the composer.json file and fire composer update, (*6)

"RayanTools/l5-modular": "dev-master"

Once this operation is complete, simply add the service provider to your project's config/app.php, (*7)

Service Provider

RayanTools\L5Modular\ModuleServiceProvider::class,

, (*8)

Getting 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 if necessary., (*9)

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

This is how the generated module would look like:, (*11)

laravel-project/
    app/
    |-- Modules/
        |-- FooBar/
            |-- Controllers/
                |-- FooBarController.php
            |-- Models/
                |-- FooBar.php
            |-- Views/
                |-- index.blade.php
            |-- Translations/
                |-- en/
                    |-- example.php
            |-- routes.php
            |-- helper.php

, (*12)

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/FooBar/Views/index.blade.php when you open laravel-project:8000/foo-bar in your browser., (*13)

Disable modules

In case you want to disable one ore more modules, you can add a modules.php into your projects app/config folder. This file should return an array with the module names that should be loaded. F.a:, (*14)

return [
    'enable' => array(
        "customer",
        "contract",
        "reporting",
    ),
];

In this case L5Modular would only load this three modules customer contract reporting. Every other module in the app/Modules folder would not be loaded., (*15)

L5Modular will load all modules if there is no modules.php file in the config folder., (*16)

Change template

In case you want to change template, you can edit a view.php into your projects app/config folder and add key template with value template name., (*17)

return [
    'template' => 'default'
];

default template generated would look like:, (*18)

laravel-project/
    resources/
        themes/
        |-- default/
            |-- Module1/
                |-- index.blade.php
            |-- Module2/
                |-- index.blade.php
            |-- Module3/
                |-- index.blade.php                

Update to 1.3.0

Since version 1.3.0 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., (*19)

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., (*20)

License

L5Modular is licensed under the terms of the MIT License (See LICENSE file for details)., (*21)


The Versions

31/01 2017

dev-master

9999999-dev https://github.com/RayanTools/L5Modular

Modular pattern generator for Laravel 5

  Sources   Download

MIT

The Requires

 

by Rayan Tools

laravel generator structure module pattern artisan modules modular l5modular rayantools rayanteam

30/11 2016

1.3.4

1.3.4.0 https://github.com/Artem-Schander/L5Modular

Modular pattern generator for Laravel 5

  Sources   Download

MIT

The Requires

 

by Artem Schander

laravel generator structure module pattern artisan modules modular artem schander l5modular

16/11 2016

1.3.3

1.3.3.0 https://github.com/Artem-Schander/L5Modular

Modular pattern generator for Laravel 5

  Sources   Download

MIT

The Requires

 

by Artem Schander

laravel generator structure module pattern artisan modules modular artem schander l5modular

10/09 2016

1.3.2

1.3.2.0 https://github.com/Artem-Schander/L5Modular

Modular pattern generator for Laravel 5

  Sources   Download

MIT

The Requires

 

by Artem Schander

laravel generator structure module pattern artisan modules modular artem schander l5modular

26/04 2016

1.3.1

1.3.1.0 https://github.com/Artem-Schander/L5Modular

Modular pattern generator for Laravel 5

  Sources   Download

MIT

The Requires

 

by Artem Schander

laravel generator structure module pattern artisan modules modular artem schander l5modular

26/12 2015

1.3.0

1.3.0.0 https://github.com/Artem-Schander/L5Modular

Modular pattern generator for Laravel 5

  Sources   Download

MIT

The Requires

 

by Artem Schander

laravel generator structure pattern artisan modules modular artem schander l5modular

06/12 2015

1.2.2

1.2.2.0 https://github.com/Artem-Schander/L5Modular

Modular pattern generator for Laravel 5

  Sources   Download

MIT

The Requires

 

by Artem Schander

laravel generator pattern artisan modular artem schander l5modular

15/07 2015

1.2.1

1.2.1.0 https://github.com/Artem-Schander/L5Modular

Modular pattern generator for Laravel 5

  Sources   Download

MIT

The Requires

 

by Artem Schander

laravel generator pattern artisan modular artem schander l5modular

09/07 2015

1.2.0

1.2.0.0 https://github.com/Artem-Schander/L5Modular

Modular pattern generator for Laravel 5

  Sources   Download

MIT

The Requires

 

by Artem Schander

laravel generator pattern artisan modular artem schander l5modular

08/07 2015

1.1.0

1.1.0.0 https://github.com/Artem-Schander/L5Modular

Modular pattern generator for Laravel 5

  Sources   Download

MIT

The Requires

 

by Artem Schander

laravel generator pattern artisan modular artem schander l5modular

22/04 2015

1.0.0

1.0.0.0 https://github.com/Artem-Schander/L5Modular

Modular pattern generator for Laravel 5

  Sources   Download

MIT

The Requires

 

by Artem Schander

laravel generator pattern artisan modular artem schander l5modular