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

v2.1.0 2025-08-04 17:35 UTC

This package is auto-updated.

Last update: 2025-08-21 23:42:26 UTC


README

Laravel TurboMaker

Supercharge your Laravel development workflow with instant module scaffolding.

Latest Version Total Downloads License PHP Version Laravel Version Tests Code Style

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

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