calebdw/laravel-sql-entities
calebdw/laravel-sql-entities maps SQL query results to typed PHP entity classes in Laravel, with attribute casting, relationships, and query integration—ideal for raw SQL, legacy schemas, and read models without full Eloquent overhead.
DB::statement() blocks in migrations (cheap, unversioned, copy-pasted) or a dedicated migration/provisioning tool. This package sits between them: Laravel-native, class-per-entity, but small and single-maintainer.ReadsClassAttributes so attribute configuration works on Laravel 12. That makes "adopt on Laravel 12 now, upgrade to 13 later" a viable path instead of a forced coupled upgrade.Consider it when:
>= v1.1.1. v1.1.0's attribute configuration path was broken on Laravel 12; anything earlier than 1.1.1 should be treated as not-Laravel-12-compatible. This is a hard floor for adoption, not a nice-to-have.Look elsewhere when:
For executives: A small, low-cost Laravel package that lets us manage database views and stored procedures as version-controlled code instead of manual DBA changes. The value is reduced environment drift and safer rollbacks on schema objects, not new customer-facing features. Cost of adoption is low; the main risk is dependency on a young, single-maintainer package, which we mitigate by pinning versions and keeping our own test coverage around generated SQL.
For engineering: v1.1.1 is a bug-fix release with two changes. First, it vendors ReadsClassAttributes into the package because the framework trait it depended on is Laravel 13-only — v1.1.0's attribute configuration was effectively broken on Laravel 12 and failing CI. Second, it removes a non-literal class-string passed to Collection::get(), which newer PHPStan rejects. Neither change alters the public API. Recommendation: treat v1.1.1 as the minimum usable version, pin it explicitly, and add a static-analysis gate in CI so future PHPStan-level breakage surfaces in our build rather than in a runtime path. Given the Laravel-13-only trait incident, budget for a compatibility review at each major framework upgrade.
How can I help you explore Laravel packages today?