{"id":19356779,"url":"https://github.com/savannabits/modular","last_synced_at":"2025-02-24T11:41:30.901Z","repository":{"id":231854428,"uuid":"782675655","full_name":"savannabits/modular","owner":"savannabits","description":"This package offers developers a simplified way of organizing Laravel Code into Modules without losing the powerful file generation API offered by Laravel. Inspired by `nwidart/laravel-modules`","archived":false,"fork":false,"pushed_at":"2024-04-10T18:06:10.000Z","size":110,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-11T10:37:40.385Z","etag":null,"topics":["code-generators","laravel-modules","modular","modules"],"latest_commit_sha":null,"homepage":"https://github.com/savannabits/modular","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/savannabits.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"Savannabits"}},"created_at":"2024-04-05T19:31:31.000Z","updated_at":"2024-04-15T06:46:13.705Z","dependencies_parsed_at":"2024-04-15T06:46:06.254Z","dependency_job_id":null,"html_url":"https://github.com/savannabits/modular","commit_stats":null,"previous_names":["savannabits/modular"],"tags_count":5,"template":false,"template_full_name":"spatie/package-skeleton-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savannabits%2Fmodular","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savannabits%2Fmodular/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savannabits%2Fmodular/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savannabits%2Fmodular/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/savannabits","download_url":"https://codeload.github.com/savannabits/modular/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240473254,"owners_count":19807106,"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":["code-generators","laravel-modules","modular","modules"],"created_at":"2024-11-10T07:05:29.340Z","updated_at":"2025-02-24T11:41:30.874Z","avatar_url":"https://github.com/savannabits.png","language":"PHP","readme":"# Organize your Laravel code into Modules\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/savannabits/modular.svg?style=flat-square)](https://packagist.org/packages/savannabits/modular)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/savannabits/modular/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/savannabits/modular/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/savannabits/modular/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/savannabits/modular/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/savannabits/modular.svg?style=flat-square)](https://packagist.org/packages/savannabits/modular)\n\nThis package offers you the simplest way to organize your Laravel code into modules.\nEach module is a separate directory that contains all the necessary files for a complete Laravel package.\nWe have tried as much as possible to use or extend the existing laravel commands and structures to offer the same rich\nfeatures that Laravel continues to ship, and make it easier to maintain the package as Laravel evolves.\n\n## Minimum Requirements\n\n- Laravel 11 or higher\n- PHP 8.2 or higher\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require savannabits/modular\n```\n\nOnce the package is installed, run the following command to prepare your app for generation of modules:\n\n```bash\nphp artisan modular:install\n```\n\nFollow the prompts to complete the installation.\n\n## Usage\n\nThis package offers several commands which allow you to generate standard Laravel files and classes in your modules.\n\n### Module Generation\n\nHowever, first you have to generate a module using the following command:\n\n```bash\nphp artisan modular:make ModuleName\n```\n\nThe above command will generate a directory structure similar to that of a standard laravel App, with an additional\nservice provider to allow registration of the module.\nThe module is generated inside the /modules directory of your project. Additionally, the command will proceed to install\nthe module as a symlinked local package in your composer file so that it can be autoloaded.\nThis process may also be triggered by using the command\n\n```bash\nphp artisan modular:activate ModuleName\n```\n\n## Activating a module\n\nRun the following command to activate a module:\n\n```bash\nphp artisan modular:activate ModuleName\n```\n\nThis command will symlink the module to the composer file and run composer dump-autoload to make the module available to\nthe application.\n\n## Deactivating a module\n\nRun the following command to deactivate a module:\n\n```bash\nphp artisan modular:deactivate ModuleName\n```\n\nThis command will remove the module from the composer file and run composer dump-autoload to remove the module from the\napplication.\n\n### Generating a Controller\n\nTo generate a controller in a module, run the following command and follow the prompts:\n\n```bash\nphp artisan modular:make-controller\n```\n\n### Generating a Model\n\nTo generate a model in a module, run the following command and follow the prompts:\n\n```bash\nphp artisan modular:make-model\n```\n\n### Generating a Migration\n\nTo generate a migration in a module, run the following command and follow the prompts:\n\n```bash\nphp artisan modular:make-migration\n```\n\n### Generating a Factory\n\nTo generate a factory in a module, run the following command and follow the prompts:\n\n```bash\nphp artisan modular:make-factory\n```\n\n### Generating a Seeder\n\nTo generate a seeder in a module, run the following command and follow the prompts:\n\n```bash\nphp artisan modular:make-seeder\n```\n\n### Generating a Policy\n\nTo generate a policy in a module, run the following command and follow the prompts:\n\n```bash\nphp artisan modular:make-policy\n```\n\n### Generating a Request\n\nTo generate a request in a module, run the following command and follow the prompts:\n\n```bash\nphp artisan modular:make-request\n```\n\n### Generating a Resource\n\nTo generate a resource in a module, run the following command and follow the prompts:\n\n```bash\nphp artisan modular:make-resource\n```\n\n### Generating a Test\n\nTo generate a test in a module, run the following command and follow the prompts:\n\n```bash\nphp artisan modular:make-test\n```\n\n### Generating a Job\n\nTo generate a job in a module, run the following command and follow the prompts:\n\n```bash\nphp artisan modular:make-job\n```\n\n### Generating a Console Command\n\nTo generate a console command in a module, run the following command and follow the prompts:\n\n```bash\nphp artisan modular:make-command\n```\n\n### Generating a Provider\n\nTo generate a provider in a module, run the following command and follow the prompts:\n\n```bash\nphp artisan modular:make-provider\n```\n\n### Generating a view\n\nTo generate a view in a module, run the following command and follow the prompts:\n\n```bash\nphp artisan modular:make-view\n```\n\n## Helpers\n\nThe package also offers a few helper functions to make it easier to work with modules.\n\n### Get all modules\n\nTo get all modules in the application, you can use the following helper function:\n\n```php\nuse Savannabits\\Modular\\Facades\\Modular;\n\n$modules = Modular::allModules();\n```\n\nThe above code will return a collection of instances of the `Savannabits\\Modular\\Module` class for all active modules in\nthe app.\n\n### Get a module\n\nTo get a specific module in the application, you can use the following helper function:\n\n```php\nuse Savannabits\\Modular\\Facades\\Modular;\n\n$module = Modular::module('ModuleName');\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Sam Maosa](https://github.com/coolsam726)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","funding_links":["https://github.com/sponsors/Savannabits"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavannabits%2Fmodular","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsavannabits%2Fmodular","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavannabits%2Fmodular/lists"}