File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,20 +23,23 @@ abstract class Plugin implements \Filament\Contracts\Plugin
2323 */
2424 protected string $ id ;
2525
26- /**
27- * Register any plugin services.
28- *
29- * @throws \Exception
30- */
31- public function register (Panel $ panel ): void
26+ public function __construct ()
3227 {
3328 $ reflection = new ReflectionClass (static ::class);
3429
3530 // Auto-detect plugin attributes
3631 $ this ->basePath = dirname ($ reflection ->getFileName (), 2 );
3732 $ this ->pluginNamespace = $ reflection ->getNamespaceName ();
3833 $ this ->id = Str::of ($ this ->pluginNamespace )->replace ('\\' , '- ' )->lower ();
34+ }
3935
36+ /**
37+ * Register any plugin services.
38+ *
39+ * @throws \Exception
40+ */
41+ public function register (Panel $ panel ): void
42+ {
4043 $ panelName = ucfirst ($ panel ->getId ());
4144
4245 // Discover all classes, even if directories do not exists — Filament already checks and skips those
You can’t perform that action at this time.
0 commit comments