2017 © Pedro Pelรกez
 

library modular

Codeurx Modular is simply a package for Laravel to help you create and manage modules.

image

codeurx/modular

Codeurx Modular is simply a package for Laravel to help you create and manage modules.

  • Monday, July 16, 2018
  • by codeurx
  • Repository
  • 1 Watchers
  • 1 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

Codeurx Modular

License Build Status Latest Stable Version Scrutinizer Code Quality , (*1)

Codeurx Modular is simply a package for Laravel to help you create and manage modules., (*2)

Install

To install through Composer, by run the following command:, (*3)

``` bash composer require codeurx/modular, (*4)


### Autoloading By default the module classes are not loaded automatically. You can autoload your modules using `psr-4`. For example: ``` json { "autoload": { "psr-4": { "App\\": "app/", "App\\Modules\\": "app/Modules/" }, "files": [ "app/Modules/helpers/helpers.php" ] } }

Tip: don't forget to run composer dump-autoload afterwards., (*5)

run the following command to publish modules table migrations:, (*6)

php artisan vendor:publish --provider="Codeurx\Modular\ModularServiceProvider" --tag="migrations"

after that run the command:, (*7)

php artisan migrate

Usage

Creating A Module, (*8)

To create a new module, simply run the following command: ``` bash php artisan modular:make , (*9)

- `<module-name>` - Replace with the name of the desired module.

**Folder Structure**

app/Modules/ โ”œโ”€โ”€ Users/ โ”œโ”€ Database/ โ”œโ”€ Migrations/ โ”œโ”€ Http/ โ”œโ”€ Controllers/ โ”œโ”€ UsersController.php โ”œโ”€ Models/ โ”œโ”€ UsersModel.php โ”œโ”€ Providers/ โ”œโ”€ UsersServiceProvider.php โ”œโ”€ Resources/ โ”œโ”€ views/ โ”œโ”€ index.blade.php โ”œโ”€ Routes/ โ”œโ”€ web.php, (*10)


You can access the url example for Users module by typing :

http://sever/users/ or http://sever/public/users/, (*11)


For Dummy data:

http://sever/users/users-test or http://sever/public/users/users-test, (*12)


**Deleting A Module** To delete a specific module, simply run the following command: ``` bash php artisan modular:delete <module-name>
  • <module-name> - Replace with the name of the desired module to be deleted.

Tip: if the module does not exist you will be asked if you want to create it., (*13)

Listing All the Modules, (*14)

To list the modules just run the following command:, (*15)

``` bash php artisan modular:list, (*16)


**Creating A Module Migration** To create a migration for a specific module just run the following command: ``` bash php artisan modular:make-migration <module-name> --table=<table-name>
  • <module-name> - Replace with the name of the desired module.
  • <table-name> - optional field, replace it with a disired name of table.

if you don't give the option --table the table name will take the name of the module by default., (*17)

Migrating Database for all modules, (*18)

bash php artisan modular:migrate, (*19)

Migrating Database for specific module, (*20)

bash php artisan modular:migrate <module-name>, (*21)

Creating a new Controller for specific module, (*22)

bash php artisan modular:make-controller <module-name> <controller-name>, (*23)

  • <module-name> - Replace with the name of the desired module.
  • <controller-name> - Replace with the controller name.

For example :, (*24)

bash php artisan modular:make-controller users TestController or, (*25)

bash php artisan modular:make-controller users Test/TestController Tip: if you typed the second command the folder structure will be like below :, (*26)

app/Modules/
      โ”œโ”€โ”€ Users/
          โ”œโ”€ Database/
             โ”œโ”€ Migrations/
          โ”œโ”€ Http/
             โ”œโ”€ Controllers/
                โ”œโ”€ Test 
                   โ”œโ”€ TestController.php
                โ”œโ”€ UsersController.php
             โ”œโ”€ Models/
                โ”œโ”€ UsersModel.php
          โ”œโ”€ Providers/
             โ”œโ”€ UsersServiceProvider.php
          โ”œโ”€ Resources/
             โ”œโ”€ views/
                โ”œโ”€ index.blade.php
          โ”œโ”€ Routes/
             โ”œโ”€ web.php 

And for the routes you should add a line like this :, (*27)

<?php

/*
|--------------------------------------------------------------------------
| Users Module Routes
|--------------------------------------------------------------------------
|
| All the routes related to the Users module have to go in here. 
|
*/

Route::get('/', 'UsersController@index');
Route::get('/users-test', 'UsersController@UsersTest');
Route::get('/test', 'Test\TestController@index');

Creating a new model for specific module, (*28)

bash php artisan modular:make-model <module-name> <model-name>, (*29)

  • <module-name> - Replace with the name of the desired module.
  • <model-name> - Replace with the model name.

For example :, (*30)

bash php artisan modular:make-model users TestModel or, (*31)

bash php artisan modular:make-model users Test/TestModel Tip: if you typed the second command the folder structure will be like below :, (*32)

app/Modules/
      โ”œโ”€โ”€ Users/
          โ”œโ”€ Database/
             โ”œโ”€ Migrations/
          โ”œโ”€ Http/
             โ”œโ”€ Controllers/
                โ”œโ”€ UsersController.php
             โ”œโ”€ Models/
                โ”œโ”€ Test 
                   โ”œโ”€ TestModel.php
                โ”œโ”€ UsersModel.php
          โ”œโ”€ Providers/
             โ”œโ”€ UsersServiceProvider.php
          โ”œโ”€ Resources/
             โ”œโ”€ views/
                โ”œโ”€ index.blade.php
          โ”œโ”€ Routes/
             โ”œโ”€ web.php 

Credits

About Amir Ali Salah

I'm a Tunisian FullStack Web Developer. For the moment i work for GIS (Gate Informatic Systems), you can visit My Website for more Informations., (*33)

License

The MIT License (MIT). Please see License File for more information., (*34)

The Versions

16/07 2018

v2.2.x-dev

2.2.9999999.9999999-dev

Codeurx Modular is simply a package for Laravel to help you create and manage modules.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Amir Ali Salah

laravel module modules modular module manager laravel module laravel modules codeurx modular modules manager

16/07 2018

dev-master

9999999-dev

Codeurx Modular is simply a package for Laravel to help you create and manage modules.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Amir Ali Salah

laravel module modules modular module manager laravel module laravel modules codeurx modular modules manager

16/07 2018

v2.2

2.2.0.0

Codeurx Modular is simply a package for Laravel to help you create and manage modules.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Amir Ali Salah

laravel module modules modular module manager laravel module laravel modules codeurx modular modules manager

16/07 2018

v2.1.x-dev

2.1.9999999.9999999-dev

Codeurx Modular is simply a package for Laravel to help you create and manage modules.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Amir Ali Salah

laravel module modules modular module manager laravel module laravel modules codeurx modular modules manager

16/07 2018

v2.1

2.1.0.0

Codeurx Modular is simply a package for Laravel to help you create and manage modules.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Amir Ali Salah

laravel module modules modular module manager laravel module laravel modules codeurx modular modules manager

16/07 2018

v2.0.x-dev

2.0.9999999.9999999-dev

Codeurx Modular is simply a package for Laravel to help you create and manage modules.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Amir Ali Salah

laravel module modules modular module manager laravel module laravel modules codeurx modular modules manager

16/07 2018

v2.0

2.0.0.0

Codeurx Modular is simply a package for Laravel to help you create and manage modules.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Amir Ali Salah

laravel module modules modular module manager laravel module laravel modules codeurx modular modules manager

16/07 2018

v1.0.x-dev

1.0.9999999.9999999-dev

Codeurx Modulara is simply a package for Laravel to help you create and manage modules.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Amir Ali Salah

laravel module modules modular module manager laravel module laravel modules modules manager codeurx modulara

16/07 2018

v1.0

1.0.0.0

Codeurx Modulara is simply a package for Laravel to help you create and manage modules.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Amir Ali Salah

laravel module modules modular module manager laravel module laravel modules modules manager codeurx modulara