PHPackages                             dcblogdev/laravel-module-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dcblogdev/laravel-module-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dcblogdev/laravel-module-generator
==================================

Generate Laravel Modules from a template.

v2.0.7(5mo ago)7811.3k—7.8%201MITPHPCI failing

Since Mar 3Pushed 5mo ago3 watchersCompare

[ Source](https://github.com/dcblogdev/laravel-module-generator)[ Packagist](https://packagist.org/packages/dcblogdev/laravel-module-generator)[ Docs](https://github.com/dcblogdev/laravel-module-generator)[ GitHub Sponsors](https://github.com/dcblogdev)[ RSS](/packages/dcblogdev-laravel-module-generator/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (10)Dependencies (8)Versions (16)Used By (1)

Community
---------

[](#community)

There is a Discord community.  For quick help, ask questions in the appropriate channel.

[![Logo](https://repository-images.githubusercontent.com/463559799/6ff80679-ea73-42b9-bcb1-cb4e0e77f475)](https://repository-images.githubusercontent.com/463559799/6ff80679-ea73-42b9-bcb1-cb4e0e77f475)

Laravel package for generating [Laravel Modules](https://github.com/nWidart/laravel-modules) from a template.

Requirements
============

[](#requirements)

PHP 8.2+ Laravel Modules package installed

Video demo
----------

[](#video-demo)

[![Intro video](https://private-user-images.githubusercontent.com/1018170/300593030-523f2c4b-a57d-4ae0-8351-6b08d7b8c87c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODYzMTQxNzQsIm5iZiI6MTc4NjMxMzg3NCwicGF0aCI6Ii8xMDE4MTcwLzMwMDU5MzAzMC01MjNmMmM0Yi1hNTdkLTRhZTAtODM1MS02YjA4ZDdiOGM4N2MucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDgwOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA4MDlUMjIxNzU0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjJjYjQxYzVkZjg5ZGVjZTUzYWM5MmFiZWJjN2MzNGY5ZTZkYmJjMDJiYzI3NDk3MGQxMjA4MzdjMWM2ZWViZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.tSIpLGW7dEcI5ryhodMGNT7vIeGVSJEv_BZQC6mkigA)](https://www.youtube.com/watch?v=BwYzfb9Fa8A&t=2s)

[https://www.youtube.com/watch?v=BwYzfb9Fa8A&amp;t=2s](https://www.youtube.com/watch?v=BwYzfb9Fa8A&t=2s)

Install
=======

[](#install)

You can install the package via composer:

```
composer require dcblogdev/laravel-module-generator
```

Publish both the `config` and `stubs`:

```
php artisan vendor:publish --provider="Dcblogdev\ModuleGenerator\ModuleGeneratorServiceProvider"
```

This will publish a `module-generator.php` config file

This contains:

```
'template' => [
    'Breeze - Blade - CRUD Web & API' => 'stubs/module-generator/breeze-crud-full',
    'Breeze - Blade - CRUD Web only' => 'stubs/module-generator/breeze-crud-web',
    'Breeze - Blade - CRUD API only' => 'stubs/module-generator/breeze-crud-api'
],
'ignore_files' => ['module.json']
```

By default, the stubs will be located at stubs/module-generator you can add your paths by adding folders and updating the config file.

Usage
=====

[](#usage)

```
php artisan module:build
```

[![300550938-529c214d-a02a-4577-8904-c865b2f41f7e](https://private-user-images.githubusercontent.com/1018170/300574334-82c0828f-b9d6-4eff-b7ca-908b46fe37e7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RobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDgwOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA4MDlUMjIxNzU0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OGE0ZWY5NTI4YTgwNTg5N2JjZTMzM2YyMjE4NGI4ZDQ0YjNlOWIwMGMyM2RlYWRmYjU4MzA5ZDcyM2M3OGQ5MCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.jb9rISGql6z-SyvJyv7SJKc63f9Wz1cMKvSel71Z5x4){module?} is the name of the module you want to create. If you don't provide a name you will be asked to enter one.

{template?} is the name of the template you want to use. If you don't provide a name you will be asked to enter one.

```
php artisan module:build Contacts "Breeze - CRUD API only"
```

Once a module has been created, enable it:

```
php artisan module:enable ModuleName
```

Then run:

```
composer dump-autoload
```

Create or update the stubs file. The filename and contents should have placeholders for example `ModulesController` will be replaced with your name + Controller. ie `ContactsController` when the command is executed.

Placeholders:
-------------

[](#placeholders)

These placeholders are replaced with the name provided when running `php artisan module:build`

### Used in filenames:

[](#used-in-filenames)

`Module` = Module name ie `Contacts`

`module` = Module name in lowercase ie `contacts`

`module_plural` = Plural module name in lowercase ie demo becomes `demos`

`Model` = Model name ie `Contact`

`model` = Model name in lowercase ie `contact`

### Only used inside files:

[](#only-used-inside-files)

🟦 Module Placeholders (`$name = 'PurchaseOrders'`)
--------------------------------------------------

[](#-module-placeholders-name--purchaseorders)

PlaceholderValue{Module}PurchaseOrders{Module }Purchase Orders{Module-}Purchase-Orders{Module\_}Purchase\_Orders{ModuleCamel}purchaseOrders{ModuleStudly}PurchaseOrders{ModuleTitle}Purchase Orders{module}purchaseorders{module }purchase orders{module-}purchase-orders{module\_}purchase\_orders{moduleCamel}purchaseOrders{moduleStudly}PurchaseOrders{modulePlural}purchase orders{module\_plural}purchase orders{module\_plural\_snake}purchase\_orders{module\_plural\_kebab}purchase-orders{module\_title}Purchase Orders🟩 Model Placeholders (`$model = 'PurchaseOrder'`)
-------------------------------------------------

[](#-model-placeholders-model--purchaseorder)

PlaceholderValue{Model}PurchaseOrder{Model }Purchase Order{Model-}Purchase-Order{Model\_}Purchase\_Order{ModelCamel}purchaseOrder{ModelStudly}PurchaseOrder{ModelTitle}Purchase Order{model}purchaseorder{model }purchase order{model-}purchase-order{model\_}purchase\_order{modelCamel}purchaseOrder{modelStudly}PurchaseOrder{model\_plural}purchase orders{model\_plural\_snake}purchase\_orders{model\_plural\_kebab}purchase-orders{model\_title}Purchase OrderContributing
------------

[](#contributing)

Contributions are welcome and will be fully credited.

Contributions are accepted via Pull Requests on [Github](https://github.com/dcblogdev/laravel-module-generator).

Pull Requests
-------------

[](#pull-requests)

- **Document any change in behaviour** - Make sure the `readme.md` and any other relevant documentation are kept up-to-date.
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

Security
--------

[](#security)

If you discover any security related issues, please email  email instead of using the issue tracker.

License
-------

[](#license)

license. Please see the [license file](license.md) for more information.

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance73

Regular maintenance activity

Popularity41

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~147 days

Recently: every ~181 days

Total

11

Last Release

152d ago

Major Versions

v1.0.2 → v2.0.02024-01-28

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39399156?v=4)[dcblog](/maintainers/dcblog)[@dcblog](https://github.com/dcblog)

---

Top Contributors

[![dcblogdev](https://avatars.githubusercontent.com/u/1018170?v=4)](https://github.com/dcblogdev "dcblogdev (77 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![thursdaydan](https://avatars.githubusercontent.com/u/8914312?v=4)](https://github.com/thursdaydan "thursdaydan (2 commits)")

---

Tags

laravelgeneratorlaravel-modules

### Embed Badge

![Health badge](/badges/dcblogdev-laravel-module-generator/health.svg)

```
[![Health](https://phpackages.com/badges/dcblogdev-laravel-module-generator/health.svg)](https://phpackages.com/packages/dcblogdev-laravel-module-generator)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.9k556.2M21.5k](/packages/laravel-framework)[drush/drush

Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.

2.4k61.7M839](/packages/drush-drush)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M322](/packages/laravel-ai)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103574.3k69](/packages/friendsoftypo3-content-blocks)[craftcms/cms

Craft CMS

3.6k3.7M3.4k](/packages/craftcms-cms)[illuminate/session

The Illuminate Session package.

9939.9M888](/packages/illuminate-session)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
