11<?php
22
3+ declare (strict_types=1 );
4+
35namespace Awcodes \Overlook ;
46
57use Closure ;
911use Filament \Panel ;
1012use Filament \Support \Concerns \EvaluatesClosures ;
1113
12- class OverlookPlugin implements Plugin
14+ final class OverlookPlugin implements Plugin
1315{
1416 use EvaluatesClosures;
1517 use HasColumns;
1618
17- protected array | Closure | null $ excludes = null ;
19+ protected array | Closure | null $ excludes = null ;
1820
19- protected array | Closure | null $ includes = null ;
21+ protected array | Closure | null $ includes = null ;
2022
21- protected bool | Closure | null $ shouldAbbreviateCount = null ;
23+ protected bool | Closure | null $ shouldAbbreviateCount = null ;
2224
23- protected bool | Closure | null $ shouldShowTooltips = null ;
25+ protected bool | Closure | null $ shouldShowTooltips = null ;
2426
25- protected int | Closure | null $ shouldSortAlphabetical = null ;
27+ protected int | Closure | null $ shouldSortAlphabetical = null ;
2628
27- protected int | Closure | null $ sort = null ;
29+ protected int | Closure | null $ sort = null ;
2830
29- protected array | Closure | null $ icons = null ;
31+ protected array | Closure | null $ icons = null ;
3032
31- public function getId (): string
33+ public static function make (): static
3234 {
33- return ' awcodes/overlook ' ;
35+ return app ( self ::class) ;
3436 }
3537
36- public function register ( Panel $ panel ): void
38+ public static function get ( ): static
3739 {
40+ return filament (app (static ::class)->getId ());
3841 }
3942
40- public function boot ( Panel $ panel ): void
43+ public function getId ( ): string
4144 {
45+ return 'awcodes/overlook ' ;
4246 }
4347
44- public static function make (): static
45- {
46- return app (static ::class);
47- }
48+ public function register (Panel $ panel ): void {}
4849
49- public static function get (): static
50- {
51- return filament (app (static ::class)->getId ());
52- }
50+ public function boot (Panel $ panel ): void {}
5351
54- public function alphabetical (bool | Closure | null $ condition = true ): static
52+ public function alphabetical (bool | Closure | null $ condition = true ): static
5553 {
5654 $ this ->shouldSortAlphabetical = $ condition ;
5755
5856 return $ this ;
5957 }
6058
61- public function abbreviateCount (bool | Closure | null $ condition = true ): static
59+ public function abbreviateCount (bool | Closure | null $ condition = true ): static
6260 {
6361 $ this ->shouldAbbreviateCount = $ condition ;
6462
6563 return $ this ;
6664 }
6765
68- public function excludes (array | Closure $ resources ): static
66+ public function excludes (array | Closure $ resources ): static
6967 {
7068 $ this ->excludes = $ resources ;
7169
@@ -103,7 +101,7 @@ public function getSort(): int
103101 return $ this ->evaluate ($ this ->sort ) ?? -1 ;
104102 }
105103
106- public function includes (array | Closure $ resources ): static
104+ public function includes (array | Closure $ resources ): static
107105 {
108106 $ this ->includes = $ resources ;
109107
@@ -125,21 +123,21 @@ public function shouldSortAlphabetical(): bool
125123 return $ this ->evaluate ($ this ->shouldSortAlphabetical ) ?? false ;
126124 }
127125
128- public function sort (int | Closure $ sort ): static
126+ public function sort (int | Closure $ sort ): static
129127 {
130128 $ this ->sort = $ sort ;
131129
132130 return $ this ;
133131 }
134132
135- public function tooltips (bool | Closure | null $ condition = true ): static
133+ public function tooltips (bool | Closure | null $ condition = true ): static
136134 {
137135 $ this ->shouldShowTooltips = $ condition ;
138136
139137 return $ this ;
140138 }
141139
142- public function icons (array | Closure | null $ icons ): static
140+ public function icons (array | Closure | null $ icons ): static
143141 {
144142 $ this ->icons = $ icons ;
145143
0 commit comments