Skip to content

Commit

Permalink
Update HasModelExtending.php
Browse files Browse the repository at this point in the history
  • Loading branch information
wychoong authored Sep 12, 2024
1 parent fc20edb commit 658a247
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/core/src/Base/Traits/HasModelExtending.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ public static function modelClass(): string
return ModelManifest::get($contractClass) ?? static::class;
}

/**
* Returns the model alias registered in the model relation morph map.
*/
public static function morphName():string{
return (new (static::modelClass()))->getMorphClass();
}

public function getMorphClass(): string
{
$morphMap = Relation::morphMap();
Expand Down

0 comments on commit 658a247

Please sign in to comment.