Polymorphic Relations: Custom Polymorphic Types

Use Illuminate\Database\Eloquent\Relations\Relation;

Relation::morphMap([
    'posts' => 'App\Post',
    'videos' => 'App\Video',
]);

Polymorphic Relations: Custom Polymorphic Types — Structure map

Clickable & Draggable!

Polymorphic Relations: Custom Polymorphic Types — Related pages: