Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

viewflex's avatar

BREAD (CRUD) and DDD Package for Laravel

Eric Evans' book, Domain-Driven Design (the DDD bible), provides a great conceptual framework for modeling large applications, where complexity can easily get out of hand. But how does one apply that to development in the Laravel framework in such a way that the two support rather than struggle against each other?

I've seen some good Laravel-DDD examples at the application level, but with various opinionated directory structures, and a significant focus on integrating Laravel features into the core functionality, it seemed to me that somewhere along the line, the freedom to focus on modeling domains was lost in the details of the implementation.

I decided to take a different approach, requiring no fixed directory structure, and decoupling the code from Laravel-specific features to the extent possible.

For me the starting point was to build a foundation supporting easily-configured BREAD (CRUD) and context layers, for quick prototyping of simple or complex domains - integrating base controllers for both stateful web UI and API, and offering a flexible paradigm for implementing domains, configured either declaratively or by extending component classes where dictated by the complexity of a given domain.

By using the Repository Pattern to isolate use of Eloquent, I also avoided the heavy dependence on models that I've seen in other approaches.

The resulting structure supports skinny controllers, and a standardized, easily recognizable base functionality among all application domains, whether they exist in the application proper or in packages providing specific functionality.

I'd appreciate hearing your opinions on this package: https://github.com/viewflex/ligero

Note: This is not a CRUD generator, but it does include a working demo domain with migration, seed, views, and localization, which can be published and used as a domain template. Private versions of the package have been successfully deployed in production, and the latest public release includes greatly expanded documentation.

0 likes
0 replies

Please or to participate in this conversation.