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(2mo ago)7710.1k—8.3%201MITPHPCI failing

Since Mar 3Pushed 2mo 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 1mo 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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ4NTA2MDEsIm5iZiI6MTc3NDg1MDMwMSwicGF0aCI6Ii8xMDE4MTcwLzMwMDU5MzAzMC01MjNmMmM0Yi1hNTdkLTRhZTAtODM1MS02YjA4ZDdiOGM4N2MucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDMzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAzMzBUMDU1ODIxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTgxNmM0YTBkM2UzYTNhZjdlNGQwNzBiZjE2ZTVmMTA3NjEzNDcyYWUyZGQ2OWUwOTNjOTVkNDNiZGZhMDE4YSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.KzV739IxATICn-AhwABBVceQEn9BkH2mHJ_DvRZkO1s)](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.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1Ni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yMDI2MDMzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAzMzBUMDU1ODIxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MGRmYjZlN2ExY2Y3ZDBiMDkxOGJiZDM3NTU4NWE4YTQxOTFlZjYyNGRlM2M5ZTk0YjY3Yjk5YjE1ZDExOGNjMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.i3iHIkHnwPUup0fxTYX0lcj_byDWCq8hjkDWmmDe7Ic){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

54

—

FairBetter than 97% of packages

Maintenance88

Actively maintained with recent releases

Popularity40

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity57

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

60d 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

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[wnx/laravel-stats

Get insights about your Laravel Project

1.8k1.8M7](/packages/wnx-laravel-stats)[livewire/flux

The official UI component library for Livewire.

9475.0M86](/packages/livewire-flux)[nativephp/desktop

NativePHP for Desktop

34020.6k3](/packages/nativephp-desktop)[nativephp/mobile

NativePHP for Mobile

82724.0k43](/packages/nativephp-mobile)[laragear/preload

Effortlessly make a Preload script for your Laravel application.

119363.5k](/packages/laragear-preload)

PHPackages © 2026

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