Skip to content

Commit 46fd2fe

Browse files
committed
refactor: improve plugin class
1 parent 61ad7a6 commit 46fd2fe

1 file changed

Lines changed: 7 additions & 26 deletions

File tree

src/CataloguePlugin.php

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,17 @@
22

33
namespace Eclipse\Catalogue;
44

5-
use Filament\Contracts\Plugin;
5+
use Eclipse\Common\Foundation\Plugins\Plugin;
66
use Filament\Panel;
77

8-
class CataloguePlugin implements Plugin
8+
class CataloguePlugin extends Plugin
99
{
10-
public function getId(): string
11-
{
12-
return 'eclipse-catalogue';
13-
}
14-
1510
public function register(Panel $panel): void
1611
{
17-
$panel->discoverResources(__DIR__.'/Filament/Resources', 'Eclipse\\Catalogue\\Filament\\Resources');
18-
}
19-
20-
public function boot(Panel $panel): void
21-
{
22-
//
23-
}
24-
25-
public static function make(): static
26-
{
27-
return app(static::class);
28-
}
29-
30-
public static function get(): static
31-
{
32-
/** @var static $plugin */
33-
$plugin = filament(app(static::class)->getId());
34-
35-
return $plugin;
12+
if ($panel->getId() === 'frontend') {
13+
parent::register($panel);
14+
} else {
15+
$panel->discoverResources(__DIR__.'/Filament/Resources', 'Eclipse\\Catalogue\\Filament\\Resources');
16+
}
3617
}
3718
}

0 commit comments

Comments
 (0)