<commit_before># L5Modular
[![Laravel](https://img.shields.io/badge/laravel-5-orange.svg?style=flat-square)](http://laravel.com)
[![Source](https://img.shields.io/badge/source-Artem_Schander-blue.svg?style=flat-square)](https://github.com/Artem-Schander/L5Modular)
[![Release](https://img.shields.io/github/release/Artem-Schander/L5Modular.svg?style=flat-square)](https://github.com/Artem-Schander/L5Modular/releases)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://opensource.org/licenses/MIT)

This package gives you the ability to use Laravel 5 in a modular way.
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.

Thanks to zyhn for the ["Modular Structure in Laravel 5" tutorial](http://ziyahanalbeniz.blogspot.com.tr/2015/03/modular-structure-in-laravel-5.html). Well explained and helped a lot.

## Documentation

* [Installation](#installation)
* [Getting started](#getting-started)
* [Usage](#usage)


<a name="installation"></a>
## Installation

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

Add the following line to the `composer.json` file and fire `composer update`

```
"artem-schander/l5-modular": "dev-master"
```
Once this operation is complete, simply add the service provider to your project's `config/app.php`

#### Service Provider
```
'ArtemSchander\L5Modular\ModuleServiceProvider',
```

<a name="getting-started"></a>
## Getting started

The built in Artisan command `php artisan make:module name [--no-migration]` 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/
        |-- foobar/
            |-- Controllers/
                |-- FoobarController.php
            |-- Models/
                |-- Foobar.php
            |-- Views/
                |-- index.blade.php
            |-- routes.php
                
```

<a name="usage"></a>
## Usage

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


#### 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.<commit_msg>L5.1.6 readme<commit_after># L5Modular
[![Laravel](https://img.shields.io/badge/laravel-5-orange.svg?style=flat-square)](http://laravel.com)
[![Source](https://img.shields.io/badge/source-Artem_Schander-blue.svg?style=flat-square)](https://github.com/Artem-Schander/L5Modular)
[![Release](https://img.shields.io/github/release/Artem-Schander/L5Modular.svg?style=flat-square)](https://github.com/Artem-Schander/L5Modular/releases)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://opensource.org/licenses/MIT)

This package gives you the ability to use Laravel 5 in a modular way.
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.

Thanks to zyhn for the ["Modular Structure in Laravel 5" tutorial](http://ziyahanalbeniz.blogspot.com.tr/2015/03/modular-structure-in-laravel-5.html). Well explained and helped a lot.

## Documentation

* [Installation](#installation)
* [Getting started](#getting-started)
* [Usage](#usage)


<a name="installation"></a>
## Installation

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

Add the following line to the `composer.json` file and fire `composer update`

```
"artem-schander/l5-modular": "dev-master"
```
Once this operation is complete, simply add the service provider to your project's `config/app.php`

#### Service Provider
```
ArtemSchander\L5Modular\ModuleServiceProvider::class,
```

<a name="getting-started"></a>
## Getting started

The built in Artisan command `php artisan make:module name [--no-migration]` 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/
        |-- foobar/
            |-- Controllers/
                |-- FoobarController.php
            |-- Models/
                |-- Foobar.php
            |-- Views/
                |-- index.blade.php
            |-- routes.php
                
```

<a name="usage"></a>
## Usage

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


#### 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.
{'fraction_non_alphanumeric': 0.12891918208373904, 'fraction_numerical': 0.008373904576436221, 'mean_word_length': 3.660617059891107, 'pattern_counts': {'":': 2, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4678410', 'n_tokens_mistral': 1634, 'n_tokens_neox': 1529, 'n_words': 474}