Download the PHP package tgozo/laravel-codegen without Composer
On this page you can find all versions of the php package tgozo/laravel-codegen. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tgozo/laravel-codegen
More information about tgozo/laravel-codegen
Files in tgozo/laravel-codegen
Package laravel-codegen
Short Description A Laravel Code Generator to help you get started with a lot of staff including generating Migrations, Models, Controllers, Factories, Routes, Views, Database Seeders and Request Validation Rules.
License MIT
Informations about the package laravel-codegen
๐ Laravel CodeGen - The Ultimate Laravel Development Accelerator
Stop writing boilerplate code. Start building features.
Laravel CodeGen is a production-grade code generation suite that transforms your development workflow by automatically scaffolding complete, tested, production-ready Laravel components with terminal prompts, interactive wizards, modern frontend templates (Vue 3, React TSX, Inertia, Blade, Livewire), and domain-driven design support.
โจ Key Capabilities
- ๐โโ๏ธ 10x Faster Scaffolding: Scaffolds complete CRUD modules in seconds with zero configuration.
- ๐ช Interactive Scaffolding Wizard: Run
php artisan codegen:wizardfor interactive prompt-guided generation. - ๐จ Modern Frontend Support: Built-in support for Inertia.js Vue 3, Inertia.js React (TSX), Blade, Livewire, and TypeScript definitions.
- ๐ฐ Domain-Driven Design (DDD): Use
--domain=DomainNameto structure modules cleanly into domain namespaces. - ๐ Form Requests & Backed Enums: Auto-infer validation rules (
--requests) and scaffold PHP 8.1+ String Enums (--enum). - ๐ก๏ธ Repository Pattern: Scaffold decoupled repository interfaces and Eloquent implementations (
--repository). - โก Domain Events & Listeners: Scaffold model lifecycle events and listener classes (
--events). - ๐ OpenAPI 3.0 Spec Generator: Generate
openapi.jsonspecs automatically (php artisan codegen:openapi). - ๐ Reverse Engineering Magic: Convert existing database tables into models, migrations, and controllers (
php artisan codegen:reverse-engineer). - ๐งน Cleanup & Rollback: Safely remove all generated module artifacts with
php artisan codegen:clean {Model}. - ๐ Publishable Stubs: Customize generated code templates using
php artisan codegen:publish-stubs. - ๐งช Pest PHP Test Suite: Auto-generates comprehensive Pest PHP feature tests out of the box.
๐ฆ Installation
Install via Composer:
The package auto-registers its service provider. No extra setup required!
Optional: Publish Configuration & Custom Stubs
๐ Quick Start & CLI Usage
๐งโโ๏ธ Interactive Terminal Wizard
Run the interactive wizard powered by Laravel Prompts:
โก Scaffolding Command Flags
Command Flag Reference
| Option | Description |
|---|---|
-m, --model |
Generate Eloquent Model with casts() and relationships |
-c, --controller |
Generate RESTful Controller |
-f, --factory |
Generate Model Factory with smart faker matching |
-s, --seeder |
Generate Database Seeder |
-p, --pest |
Generate Pest PHP feature test suite |
-l, --livewire |
Generate Livewire components |
--inertia |
Generate Vue 3 Inertia pages (Index.vue, Create.vue) |
--react |
Generate React TSX Inertia pages (Index.tsx, Create.tsx) |
--types |
Generate TypeScript definition (resources/js/types/{Model}.d.ts) |
--requests |
Generate Store{Model}Request.php & Update{Model}Request.php |
--enum=Name:case1,case2 |
Generate PHP 8.1+ Backed String Enum |
--repository |
Generate Repository contract and Eloquent implementation |
--events |
Generate App\Events\{Model}Created.php and Handle{Model}Created.php |
--soft-deletes-actions |
Include restore() and forceDelete() controller methods |
--domain=Name |
Scope generated files to domain path (DDD) |
--dry-run |
Preview generated files without writing to disk |
--all |
Generate complete module suite |
--force |
Overwrite existing files |
๐ ๏ธ Specialized Commands
๐ Reverse Engineer Existing Database
Convert an existing database table or schema into models and migrations:
๐ OpenAPI 3.0 Spec Generator
Generate OpenAPI 3.0 JSON specification for frontend clients and Postman:
๐งน Module Rollback & Cleanup
Safely inspect and delete all generated files for a specific module:
๐ฆ Migration Squashing & Combining
Merge multiple incremental migrations into a single clean base migration file:
๐งช Running Package Tests
The package features a complete Pest PHP test suite built on Orchestra Testbench:
๐ Roadmap & Completed Features
- [x] API Documentation - Auto-generate OpenAPI/Swagger 3.0 spec (
codegen:openapi) - [x] Event/Listener System - Auto-generate domain events and listeners (
--events) - [x] TypeScript Integration - Auto-generate TypeScript interface definitions (
--types) - [x] React & Vue Support - Auto-generate Inertia Vue 3 & React TSX pages (
--inertia,--react) - [x] Repository Pattern - Auto-generate repository contracts & Eloquent implementations (
--repository) - [x] Interactive Terminal Wizard - Laravel Prompts guided workflow (
codegen:wizard) - [x] Custom Stubs Loader - Publish & customize package stubs (
codegen:publish-stubs) - [ ] Docker Integration - Scaffolding custom Docker configurations
- [ ] Multi-tenancy Support - Scaffolding tenant-aware models and migrations
๐ก๏ธ Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
๐ License
The MIT License (MIT). Please see License File for more information.
๐ Credits
- Takudzwa Gozo - GitHub
- All Contributors - Thank you for making this package better!