bfg/entity
BFG Entity is a lightweight Laravel package for defining domain entities as plain PHP classes. It offers attribute handling, validation, and array/JSON serialization, helping keep business logic separate from Eloquent models while staying easy to integrate and test.
Consider it only when all of the following hold:
Look elsewhere — or write ~200 lines of Artisan command yourself — when:
artisan make: customization) have real user bases.spatie/laravel-data, cuyz/valinor, or Symfony Serializer, which are well-maintained and widely deployed.To executives: This is a tiny open-source utility that demonstrates a pattern for auto-generating PHP data classes. It is not a platform or a dependency we should build a roadmap on — it has one star, no downstream users, and no support community. Its value to us is as a free reference design: it shows what entity generation looks like and lets us estimate the cost of building the same capability in-house, likely one to two engineering weeks. Recommendation: do not adopt; optionally cite as prior art when we scope our own internal generator.
To engineering: The pattern is sound and the license is permissive (MIT), so copying and adapting is legally clean. But treat it as a snippet source, not a Composer dependency — pinning an unmaintained, untested package into a Laravel service creates upgrade risk at every framework major. If the team wants this capability, the right move is a thin internal Artisan command with tests we control, or adopting a maintained alternative such as spatie/laravel-data for typed DTO generation. Either path gives us the boilerplate savings without inheriting a single-maintainer, zero-adoption risk.
How can I help you explore Laravel packages today?