2017 © Pedro Pelรกez
 

project modules-laravel

modular laravel applications

image

jminayat/modules-laravel

modular laravel applications

  • Tuesday, April 17, 2018
  • by jminayat
  • Repository
  • 2 Watchers
  • 1 Stars
  • 67 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 22 Versions
  • 16 % Grown

The README.md

JMinayaT Laravel - Modules

jminayat/modules-laravel is a package for the administration of your laravel application in modules. compatible with Laravel version 5.5 . * Installation * Usage * Artisan Commands * Facade methods * Module Methods, (*1)

Installation

Install the package through the composer., (*2)

``` bash composer require jminayat/modules-laravel, (*3)


You need to load the module folder since it does not load automatically. You can autoload your modules using `psr-4`. Edit main composer file, and add: ``` json { "autoload": { "psr-4": { "App\\": "app/", "Modules\\": "modules/" } } }

Do not forget to execute composer dump-autoload ., (*4)

You can publish the Migrations. ``` bash php artisan vendor:publish --provider="JMinayaT\Modules\ModulesServiceProvider" --tag="migrations", (*5)


After the migration has been published, you can create the table of modules by executing the migrations: ```bash php artisan migrate

You can publish the Config file (it's optional). ``` bash php artisan vendor:publish --provider="JMinayaT\Modules\ModulesServiceProvider" --tag="config", (*6)

When published, the `config/modules.php ` Config file contains:
```php
<?php

return [

  /*
   * Name of the table to use
   * default value but you may easily change it to any table you like.
   */

   'table_name'  =>  'modules',

];

Usage

Creating A Module, (*7)

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

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

To automatically add controller, model and migration when creating a new module use: `-c -d -m`
``` bash
php artisan module:create <module-name> -c -d -m
  • -c or --controller - Create controller.
  • -d or --model - Create model.
  • -m or --migration - Create migration.

Folder Structure, (*9)

modules/
  โ”œโ”€โ”€ Blog/
      โ”œโ”€โ”€ Controllers/
      โ”œโ”€โ”€ Database/
          โ”œโ”€โ”€ migrations/
      โ”œโ”€โ”€ Models/
      โ”œโ”€โ”€ Resources/
          โ”œโ”€โ”€ Assets/
          โ”œโ”€โ”€ lang/
          โ”œโ”€โ”€ views/
      โ”œโ”€โ”€ Route/
          โ”œโ”€โ”€ web.php
          โ”œโ”€โ”€ api.php
      โ”œโ”€โ”€ module.json

Artisan Commands

****Note that the command names use "test" as the name of the example module****, (*10)

module:active, (*11)

activate | disable module, use true or false., (*12)

php artisan module:active test true 

module:create, (*13)

create a new module., (*14)

php artisan module:create test

options, (*15)

  • -c or --controller - Create controller.
  • -d or --model - Create model.
  • -m or --migration - Create migration.

module:delete, (*16)

delete module., (*17)

php artisan module:delete test 

module:install, (*18)

Install module from zip file., (*19)

php artisan module:install var/this-path/test.zip 

module:list, (*20)

show list of all modules., (*21)

php artisan module:list

module:make-controller, (*22)

Create a new module controller., (*23)

php artisan module:make-controller test TestController

module:make-middleware, (*24)

Create a new module middleware class., (*25)

php artisan module:make-middleware test TestMiddleware

module:make-request, (*26)

Create a new module request class., (*27)

php artisan module:make-request test TestRequest

module:make-model, (*28)

Create a new module model., (*29)

php artisan module:make-model test TestModel

options - -m or --migration - Create migration., (*30)

module:make-migration, (*31)

Create a new module migration., (*32)

php artisan module:make-migration test create_tests_table

module:make-seeder, (*33)

Create a new module seeder class., (*34)

php artisan module:make-seeder test testSeeder

module:make-factory, (*35)

Create a new module factory class., (*36)

php artisan module:make-factory test testFactory

module:make-test, (*37)

Create a new module test class., (*38)

php artisan module:make-test test userTest

module:make-policy, (*39)

Create a new module policy class., (*40)

php artisan module:make-policy test testPolicy

module:publish, (*41)

Publish module zip file., (*42)

php artisan module:publish test

module:up, (*43)

Up config file module json., (*44)

php artisan module:up test

module:migrate, (*45)

Migrate database for all modules., (*46)

php artisan module:migrate

For migrate a specific module to use:, (*47)

php artisan module:migrate test

module:rollback, (*48)

Rollback the last module database migration., (*49)

php artisan module:rollback

For rollback a specific module to use:, (*50)

php artisan module:rollback test

module:seed, (*51)

Module Seed the database with records., (*52)

php artisan module:sedd

For seed a specific module to use:, (*53)

php artisan module:seed test

Facade Methods

Get all modules., (*54)

Module::all();

Get a specific module., (*55)

Module::get('test');

Get all active modules., (*56)

Module::getEnabled();

Get all disabled modules., (*57)

Module::getDisabled();

Check the specified module. If it exists, will return true, otherwise false., (*58)

Module::has('test');

Count all modules., (*59)

Module::count();

Install a module using the zip file., (*60)

Module::install('path/file.zip');

Migrate database the specified module., (*61)

Module::moduleMigrate('test');

Rollback database the specified module., (*62)

Module::moduleRollback('test');

Migrate the database to all modules, (*63)

Module::moduleMigrateAll();

Rollback database to all modules., (*64)

Module::moduleRollbackAll();

Module Methods

get entity from a specific module., (*65)

$module = Module::get('test');

Get module name in studlycase., (*66)

$module->studlyName();

Get the status of the module if it is active or disabled., (*67)

$module->status();

Enable the specified module., (*68)

$module->active();

Enable the specified module., (*69)

$module->disable();

Delete the specified module., (*70)

$module->delete();

Get module Path., (*71)

$module->getPath();

Get module Json file., (*72)

$module->getModuleJson();

License

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

The Versions

17/04 2018

dev-master

9999999-dev

modular laravel applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Javier Minaya Trinidad

laravel modules modular jminayat

17/04 2018

v2.0.9

2.0.9.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Javier Minaya Trinidad

laravel modules modular jminayat

17/04 2018

v2.0.8

2.0.8.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Javier Minaya Trinidad

laravel modules modular jminayat

09/04 2018

v2.0.7

2.0.7.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Javier Minaya Trinidad

laravel modules modular jminayat

05/04 2018

v2.0.6

2.0.6.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Javier Minaya Trinidad

laravel modules modular jminayat

05/04 2018

v2.0.5

2.0.5.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Javier Minaya Trinidad

laravel modules modular jminayat

04/04 2018

v2.0.4

2.0.4.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Javier Minaya Trinidad

laravel modules modular jminayat

04/04 2018

v2.0.3

2.0.3.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Javier Minaya Trinidad

laravel modules modular jminayat

04/04 2018

v2.0.2

2.0.2.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Javier Minaya Trinidad

laravel modules modular jminayat

04/04 2018

v2.0.1

2.0.1.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Javier Minaya Trinidad

laravel modules modular jminayat

31/03 2018

v2.0.0.x-dev

2.0.0.9999999-dev

modular laravel applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Javier Minaya Trinidad

laravel modules modular jminayat

31/03 2018

v2.0.0

2.0.0.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Javier Minaya Trinidad

laravel modules modular jminayat

11/03 2018

v1.0.9

1.0.9.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

by Javier Minaya Trinidad

laravel modules modular jminayat

11/03 2018

v1.0.8

1.0.8.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

by Javier Minaya Trinidad

laravel modules modular jminayat

28/01 2018

v1.0.7

1.0.7.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

by Javier Minaya Trinidad

laravel modules modular jminayat

28/01 2018

v1.0.6

1.0.6.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

by Javier Minaya Trinidad

laravel modules modular jminayat

24/01 2018

v1.0.5

1.0.5.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

by Javier Minaya Trinidad

laravel modules modular jminayat

13/01 2018

v1.0.4

1.0.4.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

by Javier Minaya Trinidad

laravel modules modular jminayat

13/01 2018

v1.0.3

1.0.3.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

by Javier Minaya Trinidad

laravel modules modular jminayat

06/01 2018

v1.0.2

1.0.2.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

by Javier Minaya Trinidad

laravel modules modular jminayat

06/01 2018

v1.0.1

1.0.1.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

by Javier Minaya Trinidad

laravel modules modular jminayat

08/12 2017

v1.0.0

1.0.0.0

modular laravel applications

  Sources   Download

MIT

The Requires

 

by Javier Minaya Trinidad

laravel modules modular jminayat