Skip to content

use morph map in laravel with alias system (will require migration if done after launch) #325

@adrenallen

Description

@adrenallen
use Illuminate\Database\Eloquent\Relations\Relation;
 
Relation::enforceMorphMap([
    'post' => 'App\Models\Post',
    'video' => 'App\Models\Video',
]);

https://laravel.com/docs/11.x/eloquent-relationships#custom-polymorphic-types

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions