kaue-f/laravel-structura
Laravel Structura provides a structured, modular foundation for Laravel apps, with generators and conventions for domains, services, repositories, actions, and DTOs. It keeps business logic organized, reduces boilerplate, and makes large codebases easier to maintain.
composer require kaue-f/laravel-structura
php artisan structura:config
The config drives namespaces, paths, and generator defaults. Treat it as the source of truth before generating resources.php artisan structura:data UserData
Define constructor properties, then hydrate it in a controller:
$data = UserData::fromRequest($request);
php artisan boost:install
make(), from(), fromArray(), or fromRequest() depending on the source. from() accepts models and Arrayable objects; fromRequest() accepts Laravel Request and FormRequest instances.FormRequest, then pass it directly to Data::fromRequest($request). Return the Data object from your controller or API resource — it implements JsonSerializable and will serialize natively.Data::fromArray($payload) to reconstitute Data objects from queued or command-line payloads.structura:service, return ServiceResult, and rely on Makeable for container resolution. This keeps service classes injectable and consistent.CacheSupport by default. Use --raw when you need an independent class without the base support.structura config to avoid namespace drift.JsonSerializable, you can return them directly from routes and controllers without wrapping them in arrays.php artisan structura:config and compare published options. Generator defaults and path handling have changed; stale config can produce unexpected namespaces.fromRequest() hydrates from request input, but validation still belongs in a FormRequest or explicit validator. Missing required constructor parameters will throw.--raw. Existing cache classes are unaffected.php artisan boost:install so command and convention guidance matches v5.1.0.InteractsWithData is a trait you can reuse in custom Data classes. Generator stubs can be overridden if your project needs different defaults.How can I help you explore Laravel packages today?