Aliasing polymorphic types in Laravel's Eloquent
December 30, 2020 — When working with polymorphic relationships in Laravel’s Eloquent, it’s important to specify the “type” of the related model. You can do this by using morphOne
, morphMany
, and morphToMany
methods.