Downloads
Stars
Version
Instead of defining custom polymorphic types inside service providers this package offers an alternative way using php 8 attributes.
Inspired by spatie/laravel-route-attributes
composer require gpanos/laravel-morph-alias-attribute
To define a morph alias for your model add the MorphAlias
attribute and pass it your alias.
<?php
#[MorphAlias('post')]
class Post extends Model
{
...
}