From f7fe2b20eef8c504b2fbefc31333e5699c6b2c83 Mon Sep 17 00:00:00 2001 From: Roj Vroemen Date: Sun, 12 May 2024 14:21:17 +0200 Subject: [PATCH] Allow string IDs (#158) --- src/FilamentFabricatorManager.php | 2 +- src/Models/Contracts/Page.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FilamentFabricatorManager.php b/src/FilamentFabricatorManager.php index 6aa9984..17d53b7 100644 --- a/src/FilamentFabricatorManager.php +++ b/src/FilamentFabricatorManager.php @@ -189,7 +189,7 @@ public function getPageUrls(): array }); } - public function getPageUrlFromId(int $id, bool $prefixSlash = false): ?string + public function getPageUrlFromId(int|string $id, bool $prefixSlash = false): ?string { $url = $this->getPageUrls()[$id]; diff --git a/src/Models/Contracts/Page.php b/src/Models/Contracts/Page.php index 8636e5a..dbe90ad 100644 --- a/src/Models/Contracts/Page.php +++ b/src/Models/Contracts/Page.php @@ -6,12 +6,12 @@ use Illuminate\Database\Eloquent\Relations\HasMany; /** - * @property-read int $id + * @property-read int|string $id * @property-read string $title * @property-read string $slug * @property-read string $layout * @property-read array $blocks - * @property-read int $parent_id + * @property-read int|string $parent_id * @property-read \Illuminate\Database\Eloquent\Collection|\Z3d0X\FilamentFabricator\Models\Contracts\Page[] $children * @property-read \Illuminate\Database\Eloquent\Collection|\Z3d0X\FilamentFabricator\Models\Contracts\Page[] $allChildren * @property-read \Illuminate\Support\Carbon $created_at