PHPackages                             mrabbani/laravel-module-manager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. mrabbani/laravel-module-manager

ActiveLaravel

mrabbani/laravel-module-manager
===============================

Laravel Module Management

v1.5.6(8y ago)885.2k13[5 issues](https://github.com/mrabbani/laravel_module_manager/issues)MITPHPPHP ^7.1.3

Since Dec 4Pushed 7y ago5 watchersCompare

[ Source](https://github.com/mrabbani/laravel_module_manager)[ Packagist](https://packagist.org/packages/mrabbani/laravel-module-manager)[ RSS](/packages/mrabbani-laravel-module-manager/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (9)Used By (0)

Laravel Module Manager
======================

[](#laravel-module-manager)

- [Introduction](#introduction)
- [Installation](#installation)
- [Folder Structure](#folder-structure)
- Uses
    - [Configuration](#configuration)
    - [Available Commands](#available-commands)
    - [Loading Component](#loading-component)
        - [Loading View](#loading-view)
        - [Loading Translation](#loading-translation)
        - [Loading Config File](#loading-config-file)
        - [Register Middleware](#register-middleware)

Introduction
============

[](#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 modules 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.

### Installation

[](#installation)

- laravel 5.4 or 5.5

    ```
    composer require mrabbani/laravel-module-manager

    ```
- Laravel 5.3, Add the following line to your `composer.json` file and run `composer install` in your terminal.

    ```
    "mrabbani/laravel-module-manager": "^1.4"

    ```

If you are using *Laravel&lt;5.5* you have to add module manager service provider to `config/app.php` file

`Mrabbani\ModuleManager\Providers\ModuleProvider::class,`

To create new module run the bellow command:

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

```

### Folder Structure

[](#folder-structure)

If your module name is `module1` the module structure will be

[![Module Structure](https://camo.githubusercontent.com/3dcf9a8a9c0a8cbff688fb8fab2bb018287c90c38b306b2fbb8c888b9b140166/68747470733a2f2f6d72616262616e692e6769746875622e696f2f7075626c69632f696d616765732f6d6f64756c655f7374727563747572652e706e67 "Module Structure")](https://camo.githubusercontent.com/3dcf9a8a9c0a8cbff688fb8fab2bb018287c90c38b306b2fbb8c888b9b140166/68747470733a2f2f6d72616262616e692e6769746875622e696f2f7075626c69632f696d616765732f6d6f64756c655f7374727563747572652e706e67)

### Configuration

[](#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

`php artisan vendor:publish`

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

### Available Commands

[](#available-commands)

To see all module related commands run `php artisan` into terminal. Available commands are:

- `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: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:make:seeder {alias} {SeederClassName}`
- `php artisan module:db:seed {alias}`
- `php artisan module:db:seed {alias} --class={SeederClassName}`
- `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

You must install your module to activate

`php artisan module:install {alias}`

### Loading Component

[](#loading-component)

You have to load views, config and translation by following [laravel package](https://laravel.com/docs/5.3/packages#resources)

##### Loading View

[](#loading-view)

```
view(module_alias::view_file)

```

you may load the **module1** module's `index.blade.php` view like so:

```
view('module1::index');

```

##### Loading Translation

[](#loading-translation)

you may load the **module1** module's `welcome` line from the `messages` file like so:

```
trans('module1::messages.welcome');

```

##### Loading Config File

[](#loading-config-file)

you may load the **module1** module's `welcome` line from the `messages` file like so:

`config('messages.welcome');`

You have to merge the configurations, use the `mergeConfigFrom` method within your `ModuleServiceProvider` provider's `register` method:

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

```

##### Register Middleware

[](#register-middleware)

You should create a `MiddlewareServiceProvider` provider to register your middleware dynamically.

```

use Illuminate\Support\ServiceProvider;

class MiddlewareServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        /**
         * @var Router $router
         */
        $router = $this->app['router'];

        $router->aliasMiddleware('middleware-shortname', MiddlewareClassName::class);
    }
}

```

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

#### Credit

[](#credit)

[WebEd](https://github.com/sgsoft-studio/webed)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 91.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~70 days

Recently: every ~118 days

Total

8

Last Release

2951d ago

PHP version history (3 changes)v1.0PHP &gt;=5.6.4

v1.5.5PHP &gt;=7.0.0

v1.5.6PHP ^7.1.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/214142386a63f059d93a41fc64913b97c3d8dca1fca5a8b91d79fc3eca47997f?d=identicon)[mrabbani](/maintainers/mrabbani)

---

Top Contributors

[![mrabbani](https://avatars.githubusercontent.com/u/4253979?v=4)](https://github.com/mrabbani "mrabbani (21 commits)")[![stoneworld](https://avatars.githubusercontent.com/u/8342615?v=4)](https://github.com/stoneworld "stoneworld (2 commits)")

---

Tags

application-designlaravelmodularmodule

### Embed Badge

![Health badge](/badges/mrabbani-laravel-module-manager/health.svg)

```
[![Health](https://phpackages.com/badges/mrabbani-laravel-module-manager/health.svg)](https://phpackages.com/packages/mrabbani-laravel-module-manager)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M683](/packages/barryvdh-laravel-ide-helper)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M529](/packages/laravel-passport)[owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

3.4k33.0M95](/packages/owen-it-laravel-auditing)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M157](/packages/orchestra-canvas)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
