From 2b8368d3b3e694561178a07f2dcae50094a386a5 Mon Sep 17 00:00:00 2001 From: Eelco Date: Fri, 26 Jan 2024 15:23:27 +0100 Subject: [PATCH 1/2] Allow the resource(s) to be overridden via config --- config/filament-database-schedule.php | 6 +++++- src/FilamentDatabaseSchedulePlugin.php | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config/filament-database-schedule.php b/config/filament-database-schedule.php index 7b9d13d..1093826 100644 --- a/config/filament-database-schedule.php +++ b/config/filament-database-schedule.php @@ -3,6 +3,7 @@ // config for HusamTariq/FilamentDatabaseSchedule use HusamTariq\FilamentDatabaseSchedule\Models\Schedule; +use HusamTariq\FilamentDatabaseSchedule\ScheduleResource; use Illuminate\Support\Str; return [ @@ -17,7 +18,10 @@ 'timezone' => env('FILAMENT_SCHEDULE_TIMEZONE', config('app.timezone')), - + 'resources' => + [ + ScheduleResource::class, + ], /** * Cache settings diff --git a/src/FilamentDatabaseSchedulePlugin.php b/src/FilamentDatabaseSchedulePlugin.php index 96ccfd3..b11a238 100644 --- a/src/FilamentDatabaseSchedulePlugin.php +++ b/src/FilamentDatabaseSchedulePlugin.php @@ -25,9 +25,7 @@ public function getId(): string public function register(Panel $panel): void { $panel - ->resources([ - ScheduleResource::class, - ]) + ->resources(config('filament-database-schedule.resources')) ; } From 96497bce144dd387cf768937c37c885ac040ab09 Mon Sep 17 00:00:00 2001 From: Eelco Date: Fri, 26 Jan 2024 15:27:55 +0100 Subject: [PATCH 2/2] wrong namespace paths --- config/filament-database-schedule.php | 2 +- src/FilamentDatabaseSchedulePlugin.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/config/filament-database-schedule.php b/config/filament-database-schedule.php index 1093826..0380a5a 100644 --- a/config/filament-database-schedule.php +++ b/config/filament-database-schedule.php @@ -3,7 +3,7 @@ // config for HusamTariq/FilamentDatabaseSchedule use HusamTariq\FilamentDatabaseSchedule\Models\Schedule; -use HusamTariq\FilamentDatabaseSchedule\ScheduleResource; +use HusamTariq\FilamentDatabaseSchedule\Filament\Resources\ScheduleResource; use Illuminate\Support\Str; return [ diff --git a/src/FilamentDatabaseSchedulePlugin.php b/src/FilamentDatabaseSchedulePlugin.php index b11a238..5ad6d9a 100644 --- a/src/FilamentDatabaseSchedulePlugin.php +++ b/src/FilamentDatabaseSchedulePlugin.php @@ -4,7 +4,6 @@ use Filament\Contracts\Plugin; use Filament\Panel; -use HusamTariq\FilamentDatabaseSchedule\Filament\Resources\ScheduleResource; class FilamentDatabaseSchedulePlugin implements Plugin {