Skip to content

Commit

Permalink
override getMorphClass method to use model namespace from model manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
repl6669 committed Sep 3, 2024
1 parent 5f877c8 commit a82f217
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/core/src/Base/Traits/HasModelExtending.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ public static function modelClass(): string
return ModelManifest::get($contractClass) ?? static::class;
}

/**
* Returns the morph class for a model class registered in the model manifest.
*/
public function getMorphClass(): string
{
return parent::getMorphClass(static::modelClass());
}

public static function isLunarInstance(): bool
{
return static::class == static::modelClass();
Expand Down

0 comments on commit a82f217

Please sign in to comment.