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.
Generate production-style Laravel feature structure from one Artisan command.
Laravel Easy Dev helps Laravel developers reduce repetitive setup around every model or feature by generating CRUD, APIs, Form Requests, Resources, optional Services and Repositories, Policies, DTOs, Tests, OpenAPI docs, Modules, frontend starter stubs, and AI-ready project context.
composer require anas/easy-dev:^3.1 --dev
php artisan easy-dev:crud Product --api --with-repository --with-service --tests --swagger
Stable release: v3.1.1
Every time you start a new Laravel feature, you often repeat the same setup:
Laravel Easy Dev helps you generate that structure from one Artisan command, so you can focus on the actual business logic.
Instead of spending 30 to 90 minutes wiring the same structure for every model, run one Artisan command and start from a consistent, team-ready architecture.



Laravel Easy Dev includes AI-friendly commands for coding agents:
php artisan easy-dev:ai-context --pretty
php artisan easy-dev:snapshot --ai
php artisan easy-dev:analyze --json
See docs/AI_GUIDE.md for token-saving workflows, safe generation rules, and prompt examples for Codex, Cursor, Claude, and ChatGPT.
composer require anas/easy-dev:^3.1 --dev
Laravel package discovery registers the service provider automatically.
php artisan easy-dev:crud Product --api --with-repository --with-service --tests --swagger
php artisan route:list --path=products
php artisan test
Publish the config when you want to customize paths, defaults, routes, validation rules, or module settings:
php artisan vendor:publish --tag=easy-dev-config
Publish stubs when you want generated code to match your team's exact style:
php artisan easy-dev:publish-stubs
Published stubs are placed in:
resources/stubs/vendor/easy-dev/
For every model or feature, you may manually create:
php artisan easy-dev:crud Product --api --with-repository --with-service --tests --swagger
One command gives you a clean starting point that you can customize.
app/
Http/
Controllers/
Api/
ProductApiController.php
Requests/
StoreProductRequest.php
UpdateProductRequest.php
Resources/
ProductResource.php
Services/
ProductService.php
Repositories/
ProductRepository.php
Policies/
ProductPolicy.php
DTOs/
ProductData.php
routes/
api.php
tests/
Feature/
ProductApiTest.php
storage/
app/
easy-dev/
openapi.json
Laravel Easy Dev can generate:
php artisan easy-dev:crud Product --api
php artisan easy-dev:crud Product --api --tests
php artisan easy-dev:crud Product --api --with-service --tests
php artisan easy-dev:crud Product --api --with-repository --with-service --with-policy --with-dto --tests --swagger
php artisan easy-dev:crud Product --module=Catalog --architecture=clean --with-service --with-repository
php artisan easy-dev:swagger
php artisan easy-dev:ai-context --pretty
| Command | Use It For |
|---|---|
easy-dev:crud |
Generate CRUD and optional layers |
easy-dev:make |
Interactive CRUD wizard |
easy-dev:test |
Generate tests |
easy-dev:swagger |
Generate OpenAPI docs |
easy-dev:analyze |
Analyze missing layers |
easy-dev:ai-context |
Export AI-ready project context |
easy-dev:snapshot |
Generate project snapshot |
easy-dev:publish-stubs |
Publish and customize stubs |
Laravel Easy Dev is useful when you are building:
It is not meant to replace Laravel or hide the framework.
It gives you a clean starting point that you can customize, edit, or delete.
Laravel Easy Dev does not force one architecture.
You can generate simple Laravel CRUD, or enable optional layers like:
Use only what fits your project.
The generated code is meant to be:
Basic CRUD generation creates:
app/
Models/Product.php
Http/Controllers/ProductController.php
Http/Controllers/Api/ProductApiController.php
Http/Requests/StoreProductRequest.php
Http/Requests/UpdateProductRequest.php
Http/Resources/ProductResource.php
Http/Resources/ProductCollection.php
database/
migrations/xxxx_xx_xx_xxxxxx_create_products_table.php
routes/
web.php
api.php
Optional flags add:
| Flag | Generated output |
|---|---|
--with-repository |
app/Repositories/ProductRepository.php, app/Repositories/Contracts/ProductRepositoryInterface.php |
--with-service |
app/Services/ProductService.php, app/Services/Contracts/ProductServiceInterface.php |
--with-policy |
app/Policies/ProductPolicy.php |
--with-dto |
app/DTOs/ProductData.php |
--with-observer |
app/Observers/ProductObserver.php |
--register-observer |
Adds #[ObservedBy] registration to the model |
--tests |
tests/Feature/ProductControllerTest.php, unit test shells |
--swagger |
storage/app/easy-dev/openapi.json |
--vue |
resources/js/components/ProductsIndex.vue |
--react |
resources/js/components/ProductsIndex.jsx |
--inertia |
resources/js/Pages/Products/Index.vue |
--livewire |
Livewire class and Blade view |
Use --api or --api-only to skip web controllers and focus on API resources.
php artisan easy-dev:crud Product --api --with-service --tests --swagger
Repository and Service layers are optional. Laravel Easy Dev does not force them. Enable them only when they match your project or team structure.
Generate clean separation between HTTP, business logic, and persistence:
php artisan easy-dev:crud Order --with-repository --with-service
Use standard Laravel structure:
php artisan easy-dev:crud Invoice --architecture=laravel
Use Clean Architecture layout inside a module:
php artisan easy-dev:crud Invoice --module=Billing --architecture=clean --with-repository --with-service
Use DDD-style module layout:
php artisan easy-dev:crud Payment --module=Billing --architecture=ddd --with-repository --with-service
Place generated files under a domain module:
php artisan easy-dev:crud Order --module=Sales --with-repository --with-service
Example module output:
app/Modules/Sales/
Models/Order.php
Http/Controllers/OrderController.php
Http/Controllers/Api/OrderApiController.php
Http/Requests/StoreOrderRequest.php
Http/Requests/UpdateOrderRequest.php
Http/Resources/OrderResource.php
Repositories/OrderRepository.php
Repositories/Contracts/OrderRepositoryInterface.php
Services/OrderService.php
Services/Contracts/OrderServiceInterface.php
Generate starter tests for a model:
php artisan easy-dev:test Product
Generate API, service, and repository test shells:
php artisan easy-dev:test Product --api --feature --unit --service --repository
Generate a basic OpenAPI file:
php artisan easy-dev:swagger Product
Generate YAML:
php artisan easy-dev:swagger Product --format=yaml
Analyze project structure and missing layers:
php artisan easy-dev:analyze
Machine-readable output for AI tools:
php artisan easy-dev:analyze --json
Apply conservative safe fixes where available:
php artisan easy-dev:analyze --fix
Auto-detect relationships from database schema and migrations:
php artisan easy-dev:sync-relations --all
Add a relationship manually:
php artisan easy-dev:add-relation Post belongsTo User
Use each generator independently:
php artisan easy-dev:repository Product
php artisan easy-dev:api-resource Product
php artisan easy-dev:policy Product
php artisan easy-dev:dto Product
php artisan easy-dev:observer Product --register
php artisan easy-dev:filter Product
php artisan easy-dev:enum OrderStatus --values=pending,paid,cancelled
Generate backend plus starter frontend files:
php artisan easy-dev:crud Product --inertia
php artisan easy-dev:crud Product --vue
php artisan easy-dev:crud Product --react
php artisan easy-dev:crud Product --livewire
These files are intentionally starter templates. They give you a consistent first screen to customize for your actual UI stack.
Give AI coding agents structured project context:
php artisan easy-dev:ai-context --pretty
php artisan easy-dev:snapshot --ai
php artisan easy-dev:info Product --ai
All major generators support --ai for quiet JSON output:
php artisan easy-dev:crud Product --api --ai
Publish stubs:
php artisan easy-dev:publish-stubs
List available stubs:
php artisan easy-dev:publish-stubs --list
Publish only selected stubs:
php artisan easy-dev:publish-stubs --only=controller.api,service.enhanced
Overwrite existing published stubs:
php artisan easy-dev:publish-stubs --force
Stub resolution order:
--stub=...config/easy-dev.php stub mappingPublish config:
php artisan vendor:publish --tag=easy-dev-config
Common settings:
Primary commands:
| Command | Purpose |
|---|---|
easy-dev:crud |
Generate CRUD and optional architecture layers |
easy-dev:make |
Interactive CRUD wizard |
easy-dev:dream |
Generate from natural language |
easy-dev:test |
Generate feature and unit test shells |
easy-dev:swagger |
Generate OpenAPI docs |
easy-dev:analyze |
Analyze missing layers and maintainability risks |
easy-dev:ai-context |
Export AI-ready project context |
easy-dev:snapshot |
Snapshot models, schemas, and relationships |
easy-dev:info |
Inspect one model |
easy-dev:publish-stubs |
Publish customizable stubs |
Pattern generators:
| Command | Purpose |
|---|---|
easy-dev:repository |
Repository and interface |
easy-dev:api-resource |
API resource and collection |
easy-dev:policy |
Authorization policy |
easy-dev:dto |
Data Transfer Object |
easy-dev:observer |
Model observer |
easy-dev:filter |
Query filter |
easy-dev:enum |
PHP enum |
easy-dev:sync-relations |
Detect and sync model relationships |
easy-dev:add-relation |
Add one relationship manually |
Run the package tests:
cd packages/laravel-easy-dev
composer test
Current local verification:
97 tests, 396 assertions
Possible future improvements:
Laravel Easy Dev is actively maintained and continuously improving.
Stay updated with:
https://github.com/anasnashat/laravel-easy-dev/discussions
https://github.com/anasnashat/laravel-easy-dev/issues
Feedback, ideas, bug reports, and feature requests are always welcome.
See docs/COMMUNITY.md for the community welcome message.
Laravel Easy Dev is actively improving.
If you use it in a project, feedback is welcome:
Open an issue or discussion on GitHub.
Laravel Easy Dev v3.1.1 is stable and ready for Laravel project use. Compatibility is verified across Laravel 9, 10, 11, 12, and 13, with GitHub Actions coverage for PHP 8.1, 8.2, 8.3, and 8.4 where supported.
Issues, discussions, pull requests, and real project feedback are welcome.
The MIT License. See LICENSE.md for details.
How can I help you explore Laravel packages today?