grazulex / laravel-turbomaker
Laravel TurboMaker is a productivity-focused package designed to supercharge your Laravel development workflow. With a single command, you can scaffold complete modules (models, migrations, controllers, routes, tests, views, and more) following best practices. It saves hours of repetitive setup work
Fund package maintenance!
Grazulex
Buy Me A Coffee
paypal.me/strauven
Requires
- php: ^8.3
- grazulex/laravel-modelschema: ^1.1.0
- illuminate/support: ^11.0|^12.0
- nesbot/carbon: ^3.10
- symfony/yaml: ^7.3
Requires (Dev)
- doctrine/dbal: ^4.2
- larastan/larastan: ^3.4
- laravel/pint: ^1.22
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.8
- pestphp/pest-plugin-laravel: ^3.2
- rector/rector: ^2.0
Suggests
- doctrine/dbal: Required for command `php artisan dev:generate-migration` to generate migrations from models
README
Supercharge your Laravel development workflow with instant module scaffolding.
Laravel TurboMaker is a productivity-focused package designed to save hours of repetitive setup work.
With a single command, you can scaffold complete modules (models, migrations, controllers, routes, tests, views, policies, factories...) following Laravel best practices.
โจ Features
- โก One-command scaffolding โ Generate a full CRUD or API module instantly
- ๐ Schema-based generation โ Define models with YAML schemas for complex projects
- ๐ฆ Complete structure โ Models, controllers, migrations, requests, resources, views & tests
- ๐ Security ready โ Generates Policies and authentication hooks out of the box
- ๐งช Built-in testing โ Pest tests automatically generated for each action
- ๐ Extensible field types โ 65+ built-in types + create custom field types
- โ๏ธ Advanced generators โ Actions, Services, Rules, Observers for clean architecture
- ๐จ Custom templates โ Override stubs and templates to match your coding style
- ๐ API & Web ready โ Separate API Resources & Controllers when needed
- ๐ Laravel 11+ compatible โ Auto-detection and smart configuration
๐ฆ Installation
composer require --dev grazulex/laravel-turbomaker
Requirements:
- PHP 8.3+
- Laravel 11.x | 12.x
๐ Quick Start
Generate Complete Module
php artisan turbo:make Post
What's Generated:
- Model:
app/Models/Post.php
with relationships - Controllers: Web & API controllers with CRUD operations
- Migrations: Database table with proper columns and indexes
- Form Requests: Validation for Store/Update operations
- API Resources: JSON transformations for API responses
- Views: Complete CRUD views (index, create, edit, show)
- Routes: Both web and API routes with correct naming
- Tests: Feature and unit tests using Pest framework
- Factory: Model factory for testing and seeding
Schema-Based Development
# Create a schema file php artisan turbo:schema create Product --fields="name:string,price:decimal,category_id:foreignId" # Generate from schema php artisan turbo:make Product --schema=Product
API-First Development
php artisan turbo:api Product --tests --policies
Generates API-only components (no views) with authentication and authorization.
Add Relationships
php artisan turbo:make Comment --belongs-to=Post --belongs-to=User
Automatically handles foreign keys, model relationships, and form integration.
๐ Documentation & Examples
๐ Complete documentation and examples have been moved to the GitHub Wiki
Quick Links:
Section | Description |
---|---|
๐ Getting Started | Installation, setup and your first module |
๐ Command Reference | Complete command documentation |
๐ Working with Relationships | Model relationships guide |
๐จ Custom Templates | Customize generated code |
โ๏ธ Configuration | Configure TurboMaker settings |
๐ข Advanced Usage | Complex patterns and enterprise features |
๐ก Real-World Examples | Blog, E-commerce, API projects |
๐ง Available Commands
Command | Purpose | Example |
---|---|---|
turbo:make |
Complete module generation | turbo:make Post --tests --factory |
turbo:api |
API-only module | turbo:api Product --policies |
turbo:schema |
Schema management | turbo:schema create User --fields="name:string,email:email" |
โก๏ธ See complete command reference
๐ญ Enterprise Features
ModelSchema Integration
- 65+ Field Types with automatic validation
- Fragment Architecture for 95% faster generation
- Enterprise Validation with diff and optimization tools
- Schema Templates for common patterns (blog, ecommerce, etc.)
Advanced Generators
- 13 Generator Types - Models, Controllers, Tests, Policies, etc.
- Smart Relationships - Automatic foreign keys and model relationships
- Custom Actions & Services - Clean architecture patterns
- Validation Rules - Custom validation with type-specific rules
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
git clone https://github.com/grazulex/laravel-turbomaker.git
cd laravel-turbomaker
composer install
./vendor/bin/pest
๏ฟฝ License
This package is open-sourced software licensed under the MIT license.
๐ Related Packages
- Laravel ModelSchema - The enterprise engine powering TurboMaker
- Schema Templates - Pre-built schema examples
Made with โค๏ธ for the Laravel community
Generate Complete Module
php artisan turbo:make Post
What's Generated:
- Model:
app/Models/Post.php
with relationships - Controllers: Web & API controllers with CRUD operations
- Migrations: Database table with proper columns and indexes
- Form Requests: Validation for Store/Update operations
- API Resources: JSON transformations for API responses
- Views: Complete CRUD views (index, create, edit, show)
- Routes: Both web and API routes with correct naming
- Tests: Feature and unit tests using Pest framework
- Factory: Model factory for testing and seeding
Schema-Based Development
# Create a schema file php artisan turbo:schema create Product --fields="name:string,price:decimal,category_id:foreignId" # Generate from schema php artisan turbo:make Product --schema=Product
API-First Development
php artisan turbo:api Product --tests --policies
Generates API-only components (no views) with authentication and authorization.
Add Relationships
php artisan turbo:make Comment --belongs-to=Post --belongs-to=User
Automatically handles foreign keys, model relationships, and form integration.
๏ฟฝ Documentation & Examples
๐ Complete documentation and examples have been moved to the GitHub Wiki
Quick Links:
Section | Description |
---|---|
๐ Getting Started | Installation, setup and your first module |
๐ Command Reference | Complete command documentation |
๐ Working with Relationships | Model relationships guide |
๐จ Custom Templates | Customize generated code |
โ๏ธ Configuration | Configure TurboMaker settings |
๐ข Advanced Usage | Complex patterns and enterprise features |
๐ก Real-World Examples | Blog, E-commerce, API projects |
๐ญ 13 Enterprise Generators
TurboMaker generates 13 different types of files for complete module scaffolding:
Generator | Files Generated | Purpose |
---|---|---|
Model | app/Models/{Name}.php |
Eloquent model with relationships |
Migration | database/migrations/create_{table}_table.php |
Database schema |
Controllers | app/Http/Controllers/{Name}Controller.php |
Web + API controllers |
Requests | app/Http/Requests/{Name}/Store{Name}Request.php |
Form validation |
Resources | app/Http/Resources/{Name}Resource.php |
API responses |
Factory | database/factories/{Name}Factory.php |
Test data generation |
Seeder | database/seeders/{Name}Seeder.php |
Database seeding |
Tests | tests/Feature/{Name}Test.php |
Feature + Unit tests |
Policies | app/Policies/{Name}Policy.php |
Authorization logic |
Observers | app/Observers/{Name}Observer.php |
Model event handlers |
Services | app/Services/{Name}Service.php |
Business logic layer |
Actions | app/Actions/{Name}/ |
CRUD action classes |
Rules | app/Rules/{Name}/ |
Custom validation rules |
๐ Available Commands
Command | Purpose | Example |
---|---|---|
turbo:make {name} |
Generate complete module | turbo:make Post --tests --factory |
turbo:api {name} |
API-only module | turbo:api Product --policies --tests |
turbo:schema {action} |
Manage YAML schemas | turbo:schema create Product --fields="name:string" |
turbo:view {name} |
Views only | turbo:view Product |
turbo:test {name} |
Tests only | turbo:test User --feature --unit |
Key Options
Option | Description |
---|---|
--schema=Product |
Use YAML schema for generation |
--fields="name:string,email:email" |
Quick field definition |
--tests |
Generate Pest tests |
--factory |
Generate model factory |
--seeder |
Generate seeder |
--policies |
Generate policies |
--actions |
Generate action classes |
--services |
Generate service classes |
--rules |
Generate validation rules |
--observers |
Generate model observers |
--belongs-to=User |
Add belongs-to relationship |
--has-many=Comment |
Add has-many relationship |
--force |
Overwrite existing files |
๐ Configuration
Publish the configuration file to customize TurboMaker:
php artisan vendor:publish --tag=turbomaker-config
Publish custom templates:
php artisan vendor:publish --tag=turbomaker-stubs
See the Configuration Wiki for complete details.
๐ฏ Field Types & Extensibility
TurboMaker includes 65+ built-in field types and supports custom field type creation:
Built-in Types
String Types: string
, text
, longText
, mediumText
Integer Types: integer
, bigInteger
, unsignedBigInteger
, tinyInteger
, smallInteger
Numeric Types: decimal
, float
, double
, boolean
Date/Time: date
, dateTime
, timestamp
, time
Geometry: point
, lineString
, polygon
, multiPoint
, multiLineString
, multiPolygon
, geometryCollection
Advanced: json
, uuid
, email
, foreignId
, morphs
, binary
, enum
, set
, fullText
, char
, year
MongoDB: objectId
, binaryUuid
Custom Field Types
Create your own field types by extending AbstractFieldType
:
// config/turbomaker.php 'custom_field_types' => [ 'money' => App\TurboMaker\FieldTypes\MoneyFieldType::class, 'slug' => App\TurboMaker\FieldTypes\SlugFieldType::class, ],
See the Field Types Wiki for complete documentation.
๐ Version Compatibility
TurboMaker | PHP | Laravel |
---|---|---|
2.x | 8.3+ | 11.x | 12.x |
๐ค Contributing
We welcome contributions! See our Contributing Guide.
Made with โค๏ธ for the Laravel community
๐ Documentation โข ๐ Report Issues โข ๐ฌ Discussions