{"id":21129431,"url":"https://github.com/mrabbani/laravel_module_manager","last_synced_at":"2025-07-09T00:32:06.750Z","repository":{"id":57020686,"uuid":"75531748","full_name":"mrabbani/laravel_module_manager","owner":"mrabbani","description":"Laravel Modular Application Manager","archived":false,"fork":false,"pushed_at":"2019-05-05T09:32:47.000Z","size":45,"stargazers_count":88,"open_issues_count":5,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-04T03:21:00.191Z","etag":null,"topics":["application-design","laravel","modular","module"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrabbani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-04T10:50:58.000Z","updated_at":"2022-08-26T09:26:10.000Z","dependencies_parsed_at":"2022-08-22T20:31:20.204Z","dependency_job_id":null,"html_url":"https://github.com/mrabbani/laravel_module_manager","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrabbani%2Flaravel_module_manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrabbani%2Flaravel_module_manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrabbani%2Flaravel_module_manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrabbani%2Flaravel_module_manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrabbani","download_url":"https://codeload.github.com/mrabbani/laravel_module_manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225472493,"owners_count":17479633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["application-design","laravel","modular","module"],"created_at":"2024-11-20T05:21:39.268Z","updated_at":"2024-11-20T05:21:39.820Z","avatar_url":"https://github.com/mrabbani.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Module Manager\n- [Introduction](#introduction)\n- [Installation](#installation)\n- [Folder Structure](#folder-structure)\n- Uses\n    - [Configuration](#configuration)\n    - [Available Commands](#available-commands)\n    - [Loading Component](#loading-component)\n        - [Loading View](#loading-view)\n        - [Loading Translation](#loading-translation)\n        - [Loading Config File](#loading-config-file)\n        - [Register Middleware](#register-middleware)\n  \n# Introduction\nWhen you work on small project, you will feel laravel default structure \nis enough. When your project grows up, you will think to divide \nyour app into  modules where each module will contain all of it resources\nsuch as Controllers, Models, Views, Migrations, Config etc. This `laravel-module-manager` \npackage will help you to manage laravel modular application easily.\n\n### Installation\n\n- laravel 5.4 or 5.5\n\n      composer require mrabbani/laravel-module-manager\n \n- Laravel 5.3, Add the following line to your `composer.json` file and run `composer install` in your terminal. \n\n      \"mrabbani/laravel-module-manager\": \"^1.4\"\n\nIf you are using *Laravel\u003c5.5* you have to add module manager service provider to `config/app.php` file\n\n`Mrabbani\\ModuleManager\\Providers\\ModuleProvider::class,`\n\nTo create new module run the bellow command:\n\n    php artisan module:create name-of-your-module\n    php artisan module:install {module_alias_name}\n    \n### Folder Structure\nIf your module name is `module1` the module structure will be\n\n![Module Structure](https://mrabbani.github.io/public/images/module_structure.png \"Module Structure\")\n\n### Configuration \n\nBy default, all of your module will be placed inside `modules` directory\ninto your application's base directory. If you want to change publish \n`module_manager` config file by\n\n`php artisan vendor:publish`\n\nNow you can change the default *modules* directory by changing \n`module_directory` value of `config/module_manager.php` file.\n\n### Available Commands\n\nTo see all module related commands run `php artisan` into terminal.\nAvailable commands are:\n\n- `php artisan module:create {alias}`\n- `php artisan module:make:controller {alias} {ControllerName}`\n- `php artisan module:make:controller {alias} {ControllerName} --resource`\n- `php artisan module:make:command {alias} {CommandName}`\n- `php artisan module:make:facade {alias} {FacadeName}`\n- `php artisan module:make:middleware {alias} {MiddlewareName}`\n- `php artisan module:make:migration {alias} {migration_name} --create --table=table_name`\n- `php artisan module:make:migration {alias} {migration_name} --table=table_name`\n- `php artisan module:make:model {alias} {ModelName}`\n- `php artisan module:make:provider {alias} {ProviderName}`\n- `php artisan module:make:request {alias} {RequestName}`\n- `php artisan module:make:service {alias} {ServiceClassName}`\n- `php artisan module:make:support {alias} {SupportClassName}`\n- `php artisan module:make:seeder {alias} {SeederClassName}`\n- `php artisan module:db:seed {alias}` \n- `php artisan module:db:seed {alias} --class={SeederClassName}`\n- `php artisan module:migrate {alias}`\n- `php artisan module:migrate:rollback {alias}`\n- `php artisan module:routes`\n- `php artisan module:install {alias}`\n- `php artisan module:uninstall {alias}`\n- `php artisan module:enable {alias}`\n- `php artisan module:disable {alias}`\n\n\u003e 'alias' is your module's alias name. you can find module's alias name in `module.json` file of module directory\n\nYou must install your module to activate \n\n``php artisan module:install {alias}``\n\n### Loading Component\nYou have to load views, config and translation by following [laravel package](https://laravel.com/docs/5.3/packages#resources) \n\n##### Loading View \n\n    view(module_alias::view_file)\n\nyou may load the **module1** module's `index.blade.php` view like so:\n\n    view('module1::index');\n\n\n##### Loading Translation\n\nyou may load the **module1** module's `welcome` line from the `messages` file like so:\n\n    trans('module1::messages.welcome');\n##### Loading Config File\n\nyou may load the **module1** module's `welcome` line from the `messages` file like so:\n\n`config('messages.welcome');`\n\n\nYou have to merge the configurations, use the `mergeConfigFrom` method within your `ModuleServiceProvider` provider's `register` method:\n    \n    public function register()\n    {\n        $this-\u003emergeConfigFrom(\n            __DIR__.'/../../config/messages.php', 'messages'\n        );\n    }\n##### Register Middleware \n\nYou should create a `MiddlewareServiceProvider` provider to register your middleware dynamically. \n\n    \n```\n\nuse Illuminate\\Support\\ServiceProvider;\n\nclass MiddlewareServiceProvider extends ServiceProvider\n{\n    /**\n     * Register any application services.\n     *\n     * @return void\n     */\n    public function register()\n    {\n        /**\n         * @var Router $router\n         */\n        $router = $this-\u003eapp['router'];\n\n        $router-\u003ealiasMiddleware('middleware-shortname', MiddlewareClassName::class);\n    }\n}\n   ```\n\n\u003e**You should register all of your module's custom provider in *ModuleServiceProvider* provider's *register* method instead application's *config/app.php* file.**\n\n\n#### Credit \n[WebEd](https://github.com/sgsoft-studio/webed)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrabbani%2Flaravel_module_manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrabbani%2Flaravel_module_manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrabbani%2Flaravel_module_manager/lists"}