{"id":14975297,"url":"https://github.com/2dojo/module_manager","last_synced_at":"2026-02-06T20:31:54.663Z","repository":{"id":56938204,"uuid":"105445343","full_name":"2dojo/module_manager","owner":"2dojo","description":"Laravel module manager","archived":false,"fork":false,"pushed_at":"2018-05-03T12:13:29.000Z","size":31,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-30T04:00:25.525Z","etag":null,"topics":["laravel","laravel5","laravel55","module-loader","module-system","modulemanager"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/2dojo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-01T13:47:32.000Z","updated_at":"2018-05-03T12:13:30.000Z","dependencies_parsed_at":"2022-08-21T01:00:10.815Z","dependency_job_id":null,"html_url":"https://github.com/2dojo/module_manager","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/2dojo/module_manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2dojo%2Fmodule_manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2dojo%2Fmodule_manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2dojo%2Fmodule_manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2dojo%2Fmodule_manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2dojo","download_url":"https://codeload.github.com/2dojo/module_manager/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2dojo%2Fmodule_manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29175222,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T20:14:21.878Z","status":"ssl_error","status_checked_at":"2026-02-06T20:14:21.443Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["laravel","laravel5","laravel55","module-loader","module-system","modulemanager"],"created_at":"2024-09-24T13:51:50.178Z","updated_at":"2026-02-06T20:31:54.644Z","avatar_url":"https://github.com/2dojo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Module manager\n\n[![Latest Stable Version](https://poser.pugx.org/2dojo/module_manager/v/stable)](https://packagist.org/packages/2dojo/module_manager)\n[![Build Status](https://travis-ci.org/2dojo/module_manager.svg?branch=master)](https://travis-ci.org/2dojo/module_manager)\n[![codecov](https://codecov.io/gh/2dojo/module_manager/branch/master/graph/badge.svg)](https://codecov.io/gh/2dojo/module_manager)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/2dojo/module_manager/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/2dojo/module_manager/?branch=master)\n[![License](https://poser.pugx.org/2dojo/module_manager/license)](https://packagist.org/packages/2dojo/module_manager)\n\n## Table of contents\n- [Installation](#installation)\n- [Module Development](#module-development)\n- [Module Manager Methods](#module-manager-methods)\n\n## Installation\nThe Module Manager can be installed via composer:\n```\ncomposer require 2dojo/module_manager\n```\n\nThis package uses Laravel auto-discovery so the ServiceProvider and the Facade automatically register itself.\n\nAfter you installed this package you have to call the **ModuleManager** facade **initializeModules** method in you **AppServiceProvider boot** method.\n\n```php\n\u003c?php\n\nnamespace App\\Providers;\n\n...\n\nclass AppServiceProvider extends ServiceProvider\n{\n    public function boot()\n    {\n        ModuleManager::initializeModules();\n    }\n}\n```\n\nIf you want to store the module options in database you need to publish the migrations and config\n```\nphp artisan vendor:publish --provider=\"TwoDojo\\ModuleManager\\ModuleManagerServiceProvider\"\n```\nRun the migrations\n```\nphp artisan migrate\n```\nAnd finally change the registry entry in the configuration to **database**\n```php\n// config/module_manager.php\n'registry' =\u003e 'database'\n```\n\n## Module Development\nYou can create your modules in a separated composer package or in your laravel project for example in the app/Modules directory.\n\n```php\n\u003c?php\n\nnamespace App\\Modules;\n\nuse TwoDojo\\Module\\AbstractModule;\n\nclass ExampleModule extends AbstractModule\n{\n    /**\n    * @var string The module display name\n    */\n    protected $name = 'ExampleModule';\n}\n```\n\nAfter that you have to register the module in the ModuleManager for example in your **AppServiceProvider register method** or if you create a separated composer package you can register it in your package ServiceProvider boot method.\n```php\n\u003c?php\n\nnamespace App\\Providers;\n\n...\n\nclass PackageServiceProvider extends ServiceProvider\n{\n    public function boot()\n    {\n        ModuleManager::registerModule(ExampleModule::class);\n        \n        ...\n    }\n}\n```\n\n## Module Manager Methods\n### registerModule\n```php\n/**\n* Register a module to the module manager.\n*\n* @param string $moduleClass The module class\n* @return bool\n*/\npublic function registerModule(string $moduleClass) : bool\n```\n\n### initializeModules\n```php\n/**\n* Initialize the registered modules\n*/\npublic function initializeModules()\n```\n\n### enableModule\n```php\n/**\n * Enable a module\n *\n * @param $uniqueName The module unique name\n * @return bool\n */\npublic function enableModule($uniqueName) : bool\n```\n\n### disableModule\n```php\n/**\n * Disable a module\n *\n * @param string $uniqueName The module unique name\n * @return bool\n */\npublic function disableModule($uniqueName) : bool\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2dojo%2Fmodule_manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2dojo%2Fmodule_manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2dojo%2Fmodule_manager/lists"}