From c863942aaa1f3d1cbb82bf1ee18bde048f1cc17e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ewilan=20Rivi=C3=A8re?= Date: Mon, 15 Apr 2024 17:07:33 +0200 Subject: [PATCH] v2.0.04 Add filter on `items()` to keep only class with inheritance from `Model` class --- src/Typed/EloquentType.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Typed/EloquentType.php b/src/Typed/EloquentType.php index c56865e..21eb056 100644 --- a/src/Typed/EloquentType.php +++ b/src/Typed/EloquentType.php @@ -46,6 +46,8 @@ public static function make(?string $modelsPath, ?string $outputPath, ?string $p $self = new self($modelsPath, $outputPath); $self->items = ClassItem::list($self->modelsPath, TypescriptableConfig::modelsSkip()); + $self->items = array_filter($self->items, fn ($item) => $item->isModel); + $self->list = $self->setList(); $self->eloquents = $self->setEloquents(); $self->setPivots();