From b82a5de58309d7350af9ea2a367b6032eb84dbbe Mon Sep 17 00:00:00 2001 From: Charlie Etienne Date: Sun, 17 Mar 2024 09:04:53 +0100 Subject: [PATCH] Add usingResource method --- src/FilamentAnnouncePlugin.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/FilamentAnnouncePlugin.php b/src/FilamentAnnouncePlugin.php index c9aa3ec..56720ff 100644 --- a/src/FilamentAnnouncePlugin.php +++ b/src/FilamentAnnouncePlugin.php @@ -13,11 +13,20 @@ class FilamentAnnouncePlugin implements Plugin { + protected string $resource = AnnouncementResource::class; + public function getId(): string { return 'filament-announce'; } + public function usingResource(string $resource): static + { + $this->resource = $resource; + + return $this; + } + public function register(Panel $panel): void { $panel @@ -26,7 +35,7 @@ public function register(Panel $panel): void fn (): string => Blade::render('@livewire(\'filament-announce\')'), ) ->resources([ - AnnouncementResource::class, + $this->resource, ]); }