anas/easy-dev
Interactive Laravel code generator for complete CRUD with repository/service patterns. Auto-detects model relationships and scaffolds policies, DTOs, observers, filters, enums, API resources, routes, and more, with dry-run mode and customizable stubs.
Complete reference for all Laravel Easy Dev v2 commands.
easy-dev:makeEnhanced CRUD generator with beautiful interactive UI.
php artisan easy-dev:make {model} [options]
model - The name of the model to generate CRUD for--with-repository - Include Repository pattern--with-service - Include Service layer--without-interface - Skip interface generation--api-only - Generate API controller only--web-only - Generate web controller only--interactive - Run in interactive mode--force - Overwrite existing files--tests - Generate test files--no-tests - Skip test generation# Basic CRUD generation
php artisan easy-dev:make Product
# With Repository and Service patterns
php artisan easy-dev:make Product --with-repository --with-service
# Interactive mode with all options
php artisan easy-dev:make Product --with-repository --with-service --interactive
# API-only CRUD
php artisan easy-dev:make Product --api-only
# Force overwrite existing files
php artisan easy-dev:make Product --force
easy-dev:crudClassic CRUD generator with Repository and Service patterns.
php artisan easy-dev:crud {model} [options]
model - The name of the model--with-repository - Generate repository pattern--with-service - Generate service layer--api-only - API controller only--web-only - Web controller only# Generate CRUD with patterns
php artisan easy-dev:crud Product --with-repository --with-service
# API-only CRUD
php artisan easy-dev:crud Product --api-only
easy-dev:sync-relationsAutomatically detect and add relationships to models based on database schema.
php artisan easy-dev:sync-relations {model?} [options]
model - The name of the model (optional if using --all)--all - Sync relationships for all models--morph-targets=MODEL1,MODEL2 - Specify polymorphic relationship targets# Sync relationships for specific model
php artisan easy-dev:sync-relations Product
# Sync relationships for all models
php artisan easy-dev:sync-relations --all
# Sync with polymorphic targets
php artisan easy-dev:sync-relations Comment --morph-targets=Post,Video,Image
easy-dev:add-relationManually add a specific relationship between models.
php artisan easy-dev:add-relation {model} {type} {related} [options]
model - The source modeltype - The relationship typerelated - The related model--method=NAME - Custom method name--foreign-key=KEY - Custom foreign key--local-key=KEY - Custom local key--pivot-table=TABLE - Custom pivot table namehasOnehasManybelongsTobelongsToManymorphTomorphOnemorphMany# Add belongsTo relationship
php artisan easy-dev:add-relation Post belongsTo User
# Add hasMany with custom method
php artisan easy-dev:add-relation User hasMany Post --method=articles
# Add belongsToMany relationship
php artisan easy-dev:add-relation User belongsToMany Role
# Add morphTo relationship
php artisan easy-dev:add-relation Comment morphTo commentable
# Add hasMany with custom foreign key
php artisan easy-dev:add-relation User hasMany Post --foreign-key=author_id
easy-dev:repositoryGenerate repository pattern files for existing models.
php artisan easy-dev:repository {model} [options]
model - The model name--without-interface - Skip interface generation--force - Overwrite existing files# Generate repository with interface
php artisan easy-dev:repository Product
# Repository without interface
php artisan easy-dev:repository Product --without-interface
# Force overwrite
php artisan easy-dev:repository Product --force
easy-dev:api-resourceGenerate API resource and collection classes.
php artisan easy-dev:api-resource {model} [options]
model - The model name--collection - Generate collection class only--resource - Generate resource class only--force - Overwrite existing files# Generate both resource and collection
php artisan easy-dev:api-resource Product
# Generate resource only
php artisan easy-dev:api-resource Product --resource
# Generate collection only
php artisan easy-dev:api-resource Product --collection
easy-dev:helpDisplay beautiful help guide with all available commands and options.
php artisan easy-dev:help [options]
--examples - Show usage examples--patterns - Show pattern explanations# Show main help
php artisan easy-dev:help
# Show with examples
php artisan easy-dev:help --examples
easy-dev:demo-uiDemonstrate the package's beautiful UI capabilities.
php artisan easy-dev:demo-ui
These options work with most commands:
--forceOverwrite existing files without prompting.
--verbose / -vShow detailed output and debug information.
--quiet / -qSuppress output except for errors.
--no-interaction / -nRun without any interactive prompts.
--help / -hShow help for the specific command.
app/Http/Controllers/{Model}Controller.php
app/Http/Controllers/Api/{Model}Controller.php
app/Http/Requests/Store{Model}Request.php
app/Http/Requests/Update{Model}Request.php
app/Repositories/{Model}Repository.php
app/Repositories/Contracts/{Model}RepositoryInterface.php
app/Services/{Model}Service.php
app/Services/Contracts/{Model}ServiceInterface.php
app/Http/Resources/{Model}Resource.php
app/Http/Resources/{Model}Collection.php
tests/Feature/{Model}ControllerTest.php
tests/Unit/{Model}ServiceTest.php
tests/Unit/{Model}RepositoryTest.php
Routes are automatically added to:
routes/web.php (for web controllers)routes/api.php (for API controllers)# Complete CRUD with patterns
php artisan easy-dev:make Product --with-repository --with-service --interactive
# Auto-detect all relationships
php artisan easy-dev:sync-relations --all
# Generate API-only CRUD
php artisan easy-dev:make Product --api-only
# Add manual relationship
php artisan easy-dev:add-relation Post belongsTo User
# Generate repository for existing model
php artisan easy-dev:repository Product
easy-dev:makeeasy-dev:sync-relations --allFor detailed help on any command:
php artisan easy-dev:{command} --help
For general package help:
php artisan easy-dev:help
For interactive assistance:
php artisan easy-dev:make {model} --interactive
How can I help you explore Laravel packages today?