vivek-mistry / laravel-code-transformer
Modifies your existing controller code for any model with one command.
Fund package maintenance!
vivek-mistry
www.paypal.com/paypalme/vicky18294
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/vivek-mistry/laravel-code-transformer
Requires
- php: ^8.2||^8.3||^8.4
Requires (Dev)
- larastan/larastan: ^2.9||^3.0
- orchestra/testbench: ^10.0.0||^9.0.0
- pestphp/pest: ^3.8
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.3||^2.0
- phpstan/phpstan-deprecation-rules: ^1.1||^2.0
- phpstan/phpstan-phpunit: ^1.3||^2.0
README
A developer-friendly Artisan command that allows you to quickly clone and transform any CRUD controller in your Laravel project — without using external packages.
It copies an existing controller (e.g., BasicController, CategoryController) and automatically replaces all class names, variable names, and related references with your new model name (e.g., Service, Product).
🛠️ Installation
Install the package via Composer:
composer require vivek-mistry/laravel-code-transformer
Execute via
php artisan make:transform-code
| Option | Description | Default |
|---|---|---|
--from= |
Source controller name (without Controller suffix) |
Basic |
--to= |
Destination controller name (without Controller suffix) |
(required) |
🧰 Notes
- Ideal for repetitive CRUD scaffolding in Laravel projects.
- Works for any existing controller in app/Http/Controllers/.
- Prompts before overwriting existing files.
- Fully local — no external package required.
Credits
- Vivek Mistry - Project creator and maintainer
License
MIT License. See LICENSE for details.