Download the PHP package dcblogdev/laravel-module-generator without Composer
On this page you can find all versions of the php package dcblogdev/laravel-module-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dcblogdev/laravel-module-generator
More information about dcblogdev/laravel-module-generator
Files in dcblogdev/laravel-module-generator
Package laravel-module-generator
Short Description Generate Laravel Modules from a template.
License MIT
Homepage https://github.com/dcblogdev/laravel-module-generator
Rated 5.00 based on 1 reviews
Informations about the package laravel-module-generator
Community
There is a Discord community. https://discord.gg/VYau8hgwrm For quick help, ask questions in the appropriate channel.
Laravel package for generating Laravel Modules from a template.
Requirements
PHP 8.2+ Laravel Modules package installed https://github.com/nWidart/laravel-modules
Video demo
https://www.youtube.com/watch?v=BwYzfb9Fa8A&t=2s
Install
You can install the package via composer:
Publish both the config
and stubs
:
This will publish a module-generator.php
config file
This contains:
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
{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.
Once a module has been created, enable it:
Then run:
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:
These placeholders are replaced with the name provided when running php artisan module:build
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:
🟦 Module Placeholders ($name = 'PurchaseOrders'
)
Placeholder | Value |
---|---|
{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'
)
Placeholder | Value |
---|---|
{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 Order |
Contributing
Contributions are welcome and will be fully credited.
Contributions are accepted via Pull Requests on Github.
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. 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
If you discover any security related issues, please email [email protected] email instead of using the issue tracker.
License
license. Please see the license file for more information.
All versions of laravel-module-generator with dependencies
symfony/filesystem Version ^6.0|^7.0
symfony/finder Version ^6.0|^7.0
laravel/prompts Version ^0.1.15|^0.3