Skip to content

Commit

Permalink
Merge pull request #19 from CharlieEtienne/CharlieEtienne-patch-2
Browse files Browse the repository at this point in the history
Add usingResource method
  • Loading branch information
rupadana authored Mar 17, 2024
2 parents 81e5869 + b82a5de commit d134831
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/FilamentAnnouncePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,7 +35,7 @@ public function register(Panel $panel): void
fn (): string => Blade::render('@livewire(\'filament-announce\')'),
)
->resources([
AnnouncementResource::class,
$this->resource,
]);
}

Expand Down

0 comments on commit d134831

Please sign in to comment.