Skip to content

Commit

Permalink
Merge pull request #94 from Team-Nifty-GmbH/add-implements-to-model-info
Browse files Browse the repository at this point in the history
add implements to ModelInfo.php
  • Loading branch information
patrickweh committed May 13, 2024
2 parents f66f295 + c7353f0 commit 379b557
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Helpers/ModelInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class ModelInfo extends BaseModelInfo
{
public ?string $morphClass = null;

public array $implements = [];

private static ?array $cachedModelInfos = null;

public static function forModel(string|Model|ReflectionClass $model): BaseModelInfo
Expand Down Expand Up @@ -69,6 +71,8 @@ public static function forModel(string|Model|ReflectionClass $model): BaseModelI

$modelInfo->morphClass = $morphClass;

$modelInfo->implements = class_implements($model) ?: [];

$modelInfo->attributes = $modelInfo
->attributes
->map(function (Attribute $attribute) use ($model) {
Expand Down

0 comments on commit 379b557

Please sign in to comment.