{"id":36982306,"url":"https://github.com/zonneplan/laravel-module-loader","last_synced_at":"2026-01-13T22:52:13.973Z","repository":{"id":36032125,"uuid":"207290545","full_name":"zonneplan/laravel-module-loader","owner":"zonneplan","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-03T11:53:55.000Z","size":48,"stargazers_count":24,"open_issues_count":2,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-12-06T14:32:31.698Z","etag":null,"topics":["laravel","php"],"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/zonneplan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-09-09T11:11:14.000Z","updated_at":"2025-12-03T11:01:49.000Z","dependencies_parsed_at":"2024-03-18T13:29:29.321Z","dependency_job_id":"0fa84edd-6604-44cf-82b8-b939eddf59a5","html_url":"https://github.com/zonneplan/laravel-module-loader","commit_stats":{"total_commits":27,"total_committers":4,"mean_commits":6.75,"dds":0.2592592592592593,"last_synced_commit":"5572d5cf757f8da0db56ff6984cd00cdbe5a0918"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/zonneplan/laravel-module-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonneplan%2Flaravel-module-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonneplan%2Flaravel-module-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonneplan%2Flaravel-module-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonneplan%2Flaravel-module-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zonneplan","download_url":"https://codeload.github.com/zonneplan/laravel-module-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonneplan%2Flaravel-module-loader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28402177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"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","php"],"created_at":"2026-01-13T22:52:13.880Z","updated_at":"2026-01-13T22:52:13.960Z","avatar_url":"https://github.com/zonneplan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Module loader inside your Laravel app\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/zonneplan/laravel-module-loader.svg?style=flat-square)](https://packagist.org/packages/zonneplan/laravel-module-loader)\n[![MIT Licensed](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Build Status](https://img.shields.io/travis/zonneplan/laravel-module-loader/master.svg?style=flat-square)](https://travis-ci.org/zonneplan/laravel-module-loader)\n[![Total Downloads](https://img.shields.io/packagist/dt/zonneplan/laravel-module-loader.svg?style=flat-square)](https://packagist.org/packages/zonneplan/laravel-module-loader)\n\n| **Laravel**  | **laravel-module-loader** |\n|---|---------------------------|\n| 5.8  | ^1.0                      |\n| 6.0  | ^1.0                      |\n| 7.0  | ^1.0                      |\n| 8.0  | ^2.0                      |\n| 9.0  | ^3.0                      |\n| 10.0  | ^4.0                     |\n| 11.0  | ^5.0                     |\n| 12.0  | ^6.0                     |\n\nThe `zonneplan/laravel-module-loader` package provides an easy to use module loader \nwhich can be used to modulize your project.\n\n## How to use\n\nFirst install the package, see the installation section.\n\n#### Creating a new module:\n\n- Create a folder, for example: `Modules` in the app directory.\n- After that create another one, for example: `User`.\n- In the root of that folder insert a `UserServiceProvider` which extends our abstract `Module` class.\n- Implement the function `getModuleNamespace()` like:\n``` php\nnamespace Modules\\User;\n\nuse Zonneplan/ModuleLoader/Module;\n\nclass UserServiceProvider extends Module\n{\n    public function getModuleNamespace(): string\n    {\n        return 'user';\n    }\n}\n```\n- Register the `UserServiceProvider` in the `config/app.php` file.\n``` php\n'providers' =\u003e [\n    Modules\\User\\UserServiceProvider::class\n]\n```\n\n#### Structure within the module:\nThe expected structure is seen below. Most of it is optional.\n\n```$xslt\napp\n├── Modules\n    ├──MyModule\n       ├──Config\n       ├──Console\n       ├──Database\n          ├──Factories\n          ├──Migrations\n       ├──Exceptions\n       ├──Http\n          ├──Controllers\n          ├──Middleware\n          ├──Requests\n          ├──Resources\n       ├──Resources\n          ├──lang\n          ├──views\n       ├──Routes\n          ├──web.php            \n          ├──api.php            \n          ├──channels.php       \n          ├──console.php        \n          ├──mcp.php        \n       ├──MyModuleServiceProvider.php\n       ├──tests\n```\n\n#### Access a view from the module:\nTo access a view from a module it will look like `'my-module::path.to.view'`\n\nFor example:\n``` php\n// In a controller\nview('user::index');\n\n// In a blade file\n@include('user::index');\n@include('user::partials.form');\n````\n \n #### Registering Policies:\n To register policies overwrite the `$policies` variable in the ServiceProvider of your module\n \n For example:\n``` php\nprotected $policies = [\n    MyModel::class =\u003e MyModelPolicy::class,\n];\n``` \n\n#### Registering Middleware:\n To register middleware overwrite the `$middleware` variable in the ServiceProvider of your module\n \n For example:\n``` php\nprotected $middleware = [\n    'my-middleware' =\u003e MyMiddleware::class,\n];\n```\n\n#### Registering Events \u0026 Listeners:\n To register events \u0026 listeners overwrite the `$listen` variable in the ServiceProvider of your module\n \n For example:\n``` php\nprotected $listen = [\n    MyEvent::class =\u003e [\n        MyListener::class\n    ],\n];\n```\n\n#### Registering Event Subscribers:\n To register event subscribers overwrite the `$subscribe` variable in the ServiceProvider of your module\n \n For example:\n``` php\nprotected $subscribe = [\n    MySubscriber::class\n];\n```\n\n#### Registering routes:\nAll modules will by default try to load all route files in the `Routes` folder.\nAny of the following files will be auto loaded:\n\n`routes.php` `api.php` `web.php` `mcp.php`\n\n## Requirements\n\nThis package requires at least Laravel 6 or higher, PHP 7.2 or higher \n\n## Installation\n\n`composer require zonneplan/laravel-module-loader`\n\nThe package will automatically register itself.\n\nRegister the namespace: `\"Modules\\\\\": \"app/Modules\"` in `composer.json` like:\n```$xslt\n \"autoload\": {\n        \"psr-4\": {\n            \"App\\\\\": \"app/\",\n            \"Modules\\\\\": \"app/Modules\"\n        },\n        ...\n``` \n\n## Authors\n\n* **Aron Rotteveel**\n* **Dennis Stolmeijer** \n* **Wout Hoeve** \n* **Johnny Borg** \n* **Rick Gout**\n* **Thijs Nijholt** \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzonneplan%2Flaravel-module-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzonneplan%2Flaravel-module-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzonneplan%2Flaravel-module-loader/lists"}