Feature Map
Laravel Scaffolder generates configurable Laravel application layers around an existing model/schema. This page is a map of the current feature set; detailed behavior lives in the linked guides so there is one source of truth for each capability.
Module Generation
The make:module command can generate:
- Repository implementation and contract
- Service implementation and contract
- DTO
- API or web controller
- Store/Update form requests
- API resource
- Action layer
- CRUD policy
- Module service provider and application registration
- Feature-test scaffolding
- Swagger/OpenAPI documentation
Use the CLI reference for the exact current flags and shortcuts.
Schema Sources
The generator can work with:
- Inline field metadata through
--fields= - An existing migration through
--from-migration - Runtime/model metadata when available
It merges and normalizes metadata for generators that need validation, relationships, DTO properties, resources, tests, or documentation.
Laravel Scaffolder does not create the Eloquent model, migration, factory, or seeder. Create those separately when your application needs them.
Repository and Service Layers
Repository and service layers are core outputs of a normal make:module run. Published base classes provide the shared behavior and can be customized in the consuming application.
See:
DTOs
DTO generation is enabled by default in the shipped configuration and can be disabled per command with --no-dto. When DTOs are disabled, generated services/actions/controllers can use array payloads instead.
See DTO generation.
Form Requests and API Resources
Use --requests to generate Store/Update requests. API resources are enabled by default unless --no-resource is supplied.
Field metadata is used to shape validation and serialization output.
Action Layer
Use --actions to generate the action layer. The current action set consists of a shared BaseAction plus module actions for:
- List
- Show
- Create
- Update
- Delete
- ListWithRelations
See Action Layer.
Policies
Use --policy for a generated CRUD policy, or --no-policy when a configured default should be suppressed.
See Policy generation.
Feature Tests
Use --tests to force feature-test generation on, or --no-test to disable it. The output directory is configurable under tests.feature.
See Test generation.
OpenAPI and Swagger UI
There are two related workflows:
make:module --swaggerfor module-oriented documentation generation.swagger:generate/swagger:init/swagger:uifor the route-based OpenAPI JSON and bundled standalone UI.
See:
Jalali Dates
The runtime API provides:
goli()andgoli_date()helpersGoliGoliDateCastHasGoliDates- Explicit
ApiResponseHelper::formatDates()support
The package does not register Carbon toJalali() / fromJalali() macros.
See Jalali Date Support and the Public PHP API.
Custom Stubs
Publish templates when you want project-specific generated code:
php artisan vendor:publish \
--provider="Efati\ModuleGenerator\ModuleGeneratorServiceProvider" \
--tag=module-generator-stubs
Templates are published to:
resources/stubs/module-generator/
Configuration
Publish the package config/base classes with:
php artisan vendor:publish \
--provider="Efati\ModuleGenerator\ModuleGeneratorServiceProvider" \
--tag=module-generator
config/module-generator.php controls the root namespace, output paths, generation defaults, Swagger UI/spec settings, and logging channel.
See the configuration guide.
Practical Recipes
For copyable commands, use: