From 256538b2323f300bebe25656e24e31ee27a91afe Mon Sep 17 00:00:00 2001 From: Lucas Giovanny Date: Tue, 14 Feb 2023 04:31:49 +0000 Subject: [PATCH] Fix custom Resource not being considered on Pages (#37) --- src/Resources/PageResource/Pages/CreatePage.php | 5 +++++ src/Resources/PageResource/Pages/EditPage.php | 5 +++++ src/Resources/PageResource/Pages/ListPages.php | 5 +++++ src/Resources/PageResource/Pages/ViewPage.php | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/src/Resources/PageResource/Pages/CreatePage.php b/src/Resources/PageResource/Pages/CreatePage.php index b6f78c7..4288c16 100644 --- a/src/Resources/PageResource/Pages/CreatePage.php +++ b/src/Resources/PageResource/Pages/CreatePage.php @@ -8,4 +8,9 @@ class CreatePage extends CreateRecord { protected static string $resource = PageResource::class; + + public static function getResource(): string + { + return config('filament-fabricator.page-resource') ?? static::$resource; + } } diff --git a/src/Resources/PageResource/Pages/EditPage.php b/src/Resources/PageResource/Pages/EditPage.php index a626770..8c27508 100644 --- a/src/Resources/PageResource/Pages/EditPage.php +++ b/src/Resources/PageResource/Pages/EditPage.php @@ -12,6 +12,11 @@ class EditPage extends EditRecord { protected static string $resource = PageResource::class; + public static function getResource(): string + { + return config('filament-fabricator.page-resource') ?? static::$resource; + } + protected function getActions(): array { return [ diff --git a/src/Resources/PageResource/Pages/ListPages.php b/src/Resources/PageResource/Pages/ListPages.php index 90c9825..34a4a66 100644 --- a/src/Resources/PageResource/Pages/ListPages.php +++ b/src/Resources/PageResource/Pages/ListPages.php @@ -10,6 +10,11 @@ class ListPages extends ListRecords { protected static string $resource = PageResource::class; + public static function getResource(): string + { + return config('filament-fabricator.page-resource') ?? static::$resource; + } + protected function getActions(): array { return [ diff --git a/src/Resources/PageResource/Pages/ViewPage.php b/src/Resources/PageResource/Pages/ViewPage.php index 44aa79e..0b9ac07 100644 --- a/src/Resources/PageResource/Pages/ViewPage.php +++ b/src/Resources/PageResource/Pages/ViewPage.php @@ -12,6 +12,11 @@ class ViewPage extends ViewRecord { protected static string $resource = PageResource::class; + public static function getResource(): string + { + return config('filament-fabricator.page-resource') ?? static::$resource; + } + protected function getActions(): array { return [