2017 © Pedro Peláez
 

laravel modules

Laravel Module Manager

image

xcms/modules

Laravel Module Manager

  • Friday, May 19, 2017
  • by jinhongjie007
  • Repository
  • 1 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 14 Versions
  • 0 % Grown

The README.md

Introduction

When you work on small project, you will feel laravel default structure is enough. When your project grows up, you will think to divide your app into module where each module will contain all of it resources such as Controllers, Models, Views, Migrations, Config etc. This laravel-module-manager package will help you to manage laravel modular application easily., (*1)

Installation

composer require mrabbani/laravel-module-manager, (*2)

Add the module manager service provider to config/app.php file, (*3)

Mrabbani\ModuleManager\Providers\ModuleProvider::class,, (*4)

To create new module run the bellow command:, (*5)

php artisan module:create name-of-your-module
php artisan module:install {module_alias_name}

If your module name is module1 the module structure will be, (*6)

Module Structure, (*7)

Configuration

By default, all of your module will be placed inside modules directory into your application's base directory. If you want to change publish module_manager config file by, (*8)

php artisan vendor:publish, (*9)

Now you can change the default modules directory by changing module_directory value of config/module_manager.php file., (*10)

Available commands

To see all module related commands run php artisan into terminal. Available commands are:, (*11)

  • php artisan module:create {alias}
  • php artisan module:make:controller {alias} {ControllerName}
  • php artisan module:make:controller {alias} {ControllerName} --resource
  • php artisan module:make:command {alias} {CommandName}
  • php artisan module:make:facade {alias} {FacadeName}
  • php artisan module:make:middleware {alias} {MiddlewareName}
  • php artisan module:make:migration {alias} {migration_name} --create --table=table_name
  • php artisan module:make:migration {alias} {migration_name} --table=table_name
  • php artisan module:make:model {alias} {ModelName}
  • php artisan module:make:model {alias} {ModelName} --migration
  • php artisan module:make:provider {alias} {ProviderName}
  • php artisan module:make:request {alias} {RequestName}
  • php artisan module:make:service {alias} {ServiceClassName}
  • php artisan module:make:support {alias} {SupportClassName}
  • php artisan module:migrate {alias}
  • php artisan module:migrate:rollback {alias}
  • php artisan module:routes
  • php artisan module:install {alias}
  • php artisan module:uninstall {alias}
  • php artisan module:enable {alias}
  • php artisan module:disable {alias}

'alias' is your module's alias name. you can find module's alias name in module.json file of module directory, (*12)

You must install your module to activate, (*13)

php artisan module:install {alias}, (*14)

Loading Component

You have to load views, config and translation by following laravel package, (*15)

Loading view
view(module_alias::view_file)

you may load the module1 module's index.blade.php view like so:, (*16)

view('module1::index');
Loading translation

you may load the module1 module's welcome line from the messages file like so:, (*17)

trans('module1::messages.welcome');
Loading config file

you may load the module1 module's welcome line from the messages file like so:, (*18)

config('messages.welcome');, (*19)

You have to merge the configurations, use the mergeConfigFrom method within your ModuleServiceProvider provider's register method:, (*20)

public function register()
{
    $this->mergeConfigFrom(
        __DIR__.'/../../config/messages.php', 'messages'
    );
}

You should register all of your module's custom provider in ModuleServiceProvider provider's register method instead application's config/app.php file., (*21)

Credit

WebEd, (*22)

The Versions

19/05 2017

dev-master

9999999-dev

Laravel Module Manager

  Sources   Download

MIT

The Requires

 

by jinhongjie

19/05 2017

v1.1.2

1.1.2.0

Laravel Module Manager

  Sources   Download

MIT

The Requires

 

by jinhongjie

15/05 2017

v1.1.1

1.1.1.0

Laravel Module Manager

  Sources   Download

MIT

The Requires

 

by jinhongjie

11/05 2017

v1.1.0

1.1.0.0

Laravel Module Manager

  Sources   Download

MIT

The Requires

 

by jinhongjie

08/05 2017

v1.0.9

1.0.9.0

Laravel Module Manager

  Sources   Download

MIT

The Requires

 

by jinhongjie

08/05 2017

v1.0.8

1.0.8.0

Laravel Module Manager

  Sources   Download

MIT

The Requires

 

by jinhongjie

08/05 2017

v1.0.7

1.0.7.0

Laravel Module Manager

  Sources   Download

MIT

The Requires

 

by jinhongjie

08/05 2017

v1.0.6

1.0.6.0

Laravel Module Manager

  Sources   Download

MIT

The Requires

 

by jinhongjie

07/05 2017

v1.0.5

1.0.5.0

Laravel Module Management

  Sources   Download

MIT

The Requires

 

by jinhongjie

06/05 2017

v1.0.4

1.0.4.0

Laravel Module Management

  Sources   Download

MIT

The Requires

 

by jinhongjie

06/05 2017

v1.0.3

1.0.3.0

Laravel Module Management

  Sources   Download

MIT

The Requires

 

by jinhongjie

05/05 2017

v1.0.2

1.0.2.0

Laravel Module Management

  Sources   Download

MIT

The Requires

 

by jinhongjie

05/05 2017

v1.0.1

1.0.1.0

Laravel Module Management

  Sources   Download

MIT

The Requires

 

by jinhongjie

05/05 2017

v1.0.0

1.0.0.0

Laravel Module Management

  Sources   Download

MIT

The Requires

 

by jinhongjie