{"id":19258929,"url":"https://github.com/lassehaslev/laravel-modules","last_synced_at":"2026-05-17T19:03:27.756Z","repository":{"id":57012593,"uuid":"76190969","full_name":"LasseHaslev/laravel-modules","owner":"LasseHaslev","description":"Use Package Development in your local projects.","archived":false,"fork":false,"pushed_at":"2017-09-24T11:28:29.000Z","size":57,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-05T09:29:17.842Z","etag":null,"topics":["hacktoberfest","laravel","laravel-modules","modules","package-development"],"latest_commit_sha":null,"homepage":null,"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/LasseHaslev.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-11T18:07:29.000Z","updated_at":"2023-03-05T01:46:03.000Z","dependencies_parsed_at":"2022-08-21T15:10:51.777Z","dependency_job_id":null,"html_url":"https://github.com/LasseHaslev/laravel-modules","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseHaslev%2Flaravel-modules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseHaslev%2Flaravel-modules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseHaslev%2Flaravel-modules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseHaslev%2Flaravel-modules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LasseHaslev","download_url":"https://codeload.github.com/LasseHaslev/laravel-modules/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240356192,"owners_count":19788513,"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":["hacktoberfest","laravel","laravel-modules","modules","package-development"],"created_at":"2024-11-09T19:14:49.711Z","updated_at":"2026-05-17T19:03:22.705Z","avatar_url":"https://github.com/LasseHaslev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lassehaslev/laravel-modules\n\u003e Use [Package development]( https://laravel.com/docs/5.3/packages ) in your local projects.\n\nStructure your applications functionality into modules and autoload the packages ServiceProviders.\n\n## Install and Setup\n1. Run ```composer require lassehaslev/laravel-modules```.\n2. *(Not needed in laravel 5.5)* Add the following line to ```providers``` in ```config/app.php``` \n    ```\n    LasseHaslev\\LaravelModules\\Providers\\ServiceProvider::class,\n    ```\n3. Ok, this step is very important: Add the following to your projects composer.json.\n    If you do not, we cannot find out where your modules are loaded from. \n\n    ```json\n    \"extra\": {\n        ...\n        \"merge-plugin\": {\n            \"include\": [\n                \"Modules/*/composer.json\"\n            ],\n            \"recurse\": true,\n            \"replace\": false,\n            \"merge-dev\": true,\n            \"merge-extra\": false,\n            \"merge-extra-deep\": false\n        }\n    }\n    ```\n4. Now, run ```php artisan modules:make-folder``` to create modules folder.\n\n### Discover packages\n\nRun `php artisan package:discover-modules` to find all packages.\n\nThis will discover vendor packages and package modules.\n\n\u003e You should replace the discover function in composer to auto update every time you run a composer command.\n\n```\n\"post-autoload-dump\": [\n    ...\n    \"@php artisan package:discover-modules\"\n]\n```\n\n\u003e Remember to run this command every time you create a new module.\n\n## Create local packages\nI recommend you to use [LasseHaslev/laravel-package-template](https://github.com/LasseHaslev/laravel-package-template) to get a flying start to your local package.\n\nGo to [LasseHaslev/laravel-package-template](https://github.com/LasseHaslev/laravel-package-template) quick package setup.\n\n## Configuration\nIf you deside to change the place where your modules lives you must change path in composer.json ```extra.merge-plugin.include```.\n\nYou must also overwrite the config for modules \n```Config::set( 'modules.path', base_dir( 'your/new/path' ) )```\n\n## Development\n``` bash\n# Install dependencies\ncomposer install\n\n# Install for running automatic tests\nyarn\n\n# Make Modules folders in orcestra to make tests work\nmkdir vendor/orchestra/testbench-core/laravel/Modules\n\n# Run one time\nnpm run test\n\n# Automaticly run test on changes\nnpm run dev\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flassehaslev%2Flaravel-modules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flassehaslev%2Flaravel-modules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flassehaslev%2Flaravel-modules/lists"}