Download the PHP package lucasandre-dev/laravel-code-generator without Composer
On this page you can find all versions of the php package lucasandre-dev/laravel-code-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lucasandre-dev/laravel-code-generator
More information about lucasandre-dev/laravel-code-generator
Files in lucasandre-dev/laravel-code-generator
Package laravel-code-generator
Short Description Code generator from templates
License MIT
Informations about the package laravel-code-generator
Laravel Code Generator
A simple code generator for Laravel projects to streamline development.
🚀 Installation and Configuration
-
Install via Composer
-
Publish the Service Provider Register the service provider in your
config/app.php
file:Note:
For Laravel versions <= 10: Registering Providers in Laravel 10
For Laravel versions >= 11: Registering Providers in Laravel 11 -
Publish Configuration and Mockups
-
Config File:
- Mockups:
-
-
Add Filesystem Configuration Add the following configuration to
config/filesystems.php
: -
Configure Template Generator Modify the configuration in
config/templates-code-generator.php
to suit your needs. -
Run Code Generation Command Execute the following command to generate code:
Note:
When running the command, you'll be prompted to provide an entity name and a template name.
📚 Documentation
🔧 Configuration File (config/templates-code-generator.php
)
- disk: Disk used for storing generated files.
- base_destination: Base path for all generated files.
- template_default: Default template used by the command to generate code.
- templates: List of templates with operations, template locations, and final dynamic destinations.
📑 Templates
Replacements:
%EntityNamespace%
: Recommended usage in the mockups namespace.%PascalCase%
: The entity name in PascalCase format.%camelCase%
: The entity name in camelCase format.
🛠️ Artisan Commands
code:generate
Options:
--force
: Force overwrite of existing files (use with caution).
Prompts:
- Entity: Name of the entity to be created. Allows subpaths (e.g.,
Path1/Path2/EntityName
). - Template: Select a template number from the options suggested in the terminal.