Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Structura

Laravel Structura Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Laravel Structura is a Laravel package that simplifies and standardizes the creation of application resources through custom Artisan commands, helping developers build clean, scalable, and well-organized projects.

Frequently asked questions about Laravel Structura
What is Laravel Structura and what problem does it solve?
Laravel Structura is a code-generation and convention package for Laravel applications. It provides custom Artisan generators for domains, services, repositories, actions, helpers, caches, and Data objects, so business logic stays organized as a codebase grows. It is not a runtime framework; it shapes how your application code is written and structured rather than how requests are executed.
How do I install kaue-f/laravel-structura in a Laravel application?
Install it with Composer using composer require kaue-f/laravel-structura (or composer update kaue-f/laravel-structura if it is already in your composer.json). After installing, publish the configuration with php artisan structura:config if you want to customize generator defaults. If you use Laravel Boost, you can also run php artisan boost:install to pick up the package's SKILL.md integration.
Which Laravel and PHP versions does Laravel Structura support?
The release notes summarized here do not state explicit Laravel or PHP version constraints. Check the require block in the package's composer.json on GitHub or Packagist before installing, since the v5 Data architecture and FormRequest integration may depend on recent Laravel releases. Pin the version you validate against so generator behavior stays predictable.
What is the Data layer in Laravel Structura and how does it relate to DTOs?
Version 5.0.0 introduced an opinionated Data layer that replaced the earlier DTO naming, so Data objects are Structura's DTO-style boundary objects. The InteractsWithData trait provides make(), from(), fromRequest(), fromArray(), and support for JsonSerializable, Arrayable, Collections, and FormRequests. That makes Data classes the canonical bridge between HTTP input, arrays, and your domain code.
Which Artisan commands does Laravel Structura provide for generating resources?
Structura ships custom Artisan generators such as structura:data for Data objects, plus generators for resources, helpers, services, and cache wrappers. Configuration is handled through structura:config, and Laravel Boost support is added with boost:install. Run php artisan list and filter for structura to see the exact commands available in your installed version.
Is upgrading from Laravel Structura v4 to v5 a breaking change?
Yes, upgrading from v4.x to v5.x is a breaking change because v5.0.0 renamed DTO to Data, and you should follow the v5.0.0 migration guide before upgrading. Upgrading within v5, such as from v5.0.0 to v5.1.0, is additive with no breaking changes and no changes required to existing generated resources. New behavior in v5.1.0 mainly applies to newly generated classes.
Does Laravel Structura lock me into its conventions and base classes?
Structura is intentionally opinionated: generated cache classes extend a CacheSupport base class unless you pass the --raw option, and generated services follow ServiceResult and Makeable conventions. This is convenient for greenfield projects but couples generated code to the package's abstractions. Retrofit cost grows with the number of generated artifacts, so decide early whether to layer your own abstractions or opt out where possible.
Can I customize the Structura config, and will regenerating overwrite my edits?
You can publish and adjust the package configuration with php artisan structura:config, and v5.1.0 made generator defaults rely more consistently on that configuration. Because generator output can change between versions even without breaking API changes, diff newly generated files in a scratch branch before adopting an upgrade. Hand-edited generated files may be overwritten on regeneration, so keep custom logic in your own classes where you can.
Does Laravel Structura integrate with Laravel Boost and AI coding tools?
Yes. The package ships a SKILL.md file and supports php artisan boost:install, which signals that it is intended to be used with Laravel Boost and AI-assisted tooling. This is a differentiating integration surface, but you should verify that the shipped conventions match your team's architecture before letting agents generate code with it. The SKILL.md was updated alongside v5.1.0.
Is Laravel Structura tested and safe to use in production?
v5.1.0 expanded test coverage, including PHP syntax validation of generated files, which is a meaningful reliability signal for a code-generation tool. The package is maintained under a single-maintainer namespace and sits in the code-generation path of your entire codebase, so pin the version and review generated diffs in pull requests. Also verify behavior for nested Data objects, partial payloads, and FormRequest validation failures yourself, since the release notes do not document those cases.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console