calebporzio/parental
Single-table inheritance for Laravel Eloquent. Store multiple model “types” in one table and let Parental automatically instantiate the right child class. Keeps polymorphic-like behavior simple, with familiar relationships, queries, and mass assignment.
Full Changelog: https://github.com/tighten/parental/compare/v1.5.0...v1.6.0
Attention: We had to rework how we detect double model event dispatching to support Laravel 13, which requires registering model events inside whenBooted callbacks (see this). If you bind event handlers to the parent class, we recommend you test it out extensively and report back if you find anything.
become method by @gcavanunez in https://github.com/tighten/parental/pull/144classToAlias to support mixed types. by @gokure in https://github.com/tighten/parental/pull/145Full Changelog: https://github.com/tighten/parental/compare/v1.4.3...v1.5.0
.gitattributes by @gcavanunez in https://github.com/tighten/parental/pull/141Full Changelog: https://github.com/tighten/parental/compare/v1.4.2...v1.4.3
Full Changelog: https://github.com/tighten/parental/compare/v1.4.1...v1.4.2
Full Changelog: https://github.com/tighten/parental/compare/v1.4.0...v1.4.1
Full Changelog: https://github.com/tighten/parental/compare/v1.3.6...v1.4.0
Full Changelog: https://github.com/tighten/parental/compare/v1.3.5...v1.3.6
Full Changelog: https://github.com/tighten/parental/compare/v1.3.4...v1.3.5
calebporzio to tightenco by @driftingly in https://github.com/tighten/parental/pull/106type field by @marcoguido in https://github.com/tighten/parental/pull/110Full Changelog: https://github.com/tighten/parental/compare/v1.3.3...v1.3.4
Full Changelog: https://github.com/tighten/parental/compare/1.3.2...v1.3.3
Full Changelog: https://github.com/calebporzio/parental/compare/v1.3.1...1.3.2
Full Changelog: https://github.com/calebporzio/parental/compare/v1.3.0...v1.3.1
Full Changelog: https://github.com/calebporzio/parental/compare/v1.2.0...v1.3.0
Full Changelog: https://github.com/calebporzio/parental/compare/v1.1.0...v1.2.0
Laravel 9 release thanks to some awesome PR work by @laravel-shift 💪
With Laravel 7 being end of lifed, moving this package forward with a new major version.
The code to this point is working, all old PRs have been closed for now - if you wish to reopen any of the submitted PRs, please merge changes downstream to your PR before reopening. This will allow us to get test coverage insights on PRs without having to pull these locally.
Soon to come: Doc blocks and typehints everywhere
Compatibility with Laravel 6.0
Enable use in Lumen.
$inheritanceColumn to $childTypeColumn$childTypeAliasesNow models created with factories will have the "type" column set.
How can I help you explore Laravel packages today?