1010class AlertBoxPlugin implements Plugin
1111{
1212 protected bool $ enabled = true ;
13+
1314 public string $ view = 'alert-box::layouts.unified-alert ' ;
1415
1516 public function getId (): string
@@ -19,7 +20,7 @@ public function getId(): string
1920
2021 public function register (Panel $ panel ): void
2122 {
22- if (!$ this ->enabled ) {
23+ if (! $ this ->enabled ) {
2324 return ;
2425 }
2526
@@ -62,7 +63,7 @@ function () use ($hook) {
6263 'position ' => $ hook , // Pass position to help determine layout type
6364 ]);
6465 },
65-
66+
6667 );
6768 }
6869 }
@@ -73,6 +74,7 @@ function () use ($hook) {
7374 public function enabled (bool $ enabled = true ): static
7475 {
7576 $ this ->enabled = $ enabled ;
77+
7678 return $ this ;
7779 }
7880
@@ -81,7 +83,8 @@ public function enabled(bool $enabled = true): static
8183 */
8284 public function disable (bool $ disable = true ): static
8385 {
84- $ this ->enabled = !$ disable ;
86+ $ this ->enabled = ! $ disable ;
87+
8588 return $ this ;
8689 }
8790
@@ -90,7 +93,7 @@ public function disable(bool $disable = true): static
9093 */
9194 public static function make (): static
9295 {
93- return new static () ;
96+ return new static ;
9497 }
9598
9699 /**
@@ -99,37 +102,38 @@ public static function make(): static
99102 public function view (string $ view ): self
100103 {
101104 $ this ->view = $ view ;
105+
102106 return $ this ;
103107 }
104108
105-
106109 /**
107110 * Define default colors for alert types
108111 */
109112 public function defineColors (array $ colors = []): self
110113 {
111114 Config::set ('alert-box.colors ' , $ colors ?: [
112115 'success ' => [
113- 'title ' => '#047857 ' ,
116+ 'title ' => '#047857 ' ,
114117 'description ' => '#10b981 ' ,
115- 'icon ' => '#10b981 ' ,
118+ 'icon ' => '#10b981 ' ,
116119 ],
117120 'danger ' => [
118- 'title ' => '#b91c1c ' ,
121+ 'title ' => '#b91c1c ' ,
119122 'description ' => '#ef4444 ' ,
120- 'icon ' => '#ef4444 ' ,
123+ 'icon ' => '#ef4444 ' ,
121124 ],
122125 'warning ' => [
123- 'title ' => '#b45309 ' ,
126+ 'title ' => '#b45309 ' ,
124127 'description ' => '#f59e0b ' ,
125- 'icon ' => '#f59e0b ' ,
128+ 'icon ' => '#f59e0b ' ,
126129 ],
127130 'info ' => [
128- 'title ' => '#1d4ed8 ' ,
131+ 'title ' => '#1d4ed8 ' ,
129132 'description ' => '#3b82f6 ' ,
130- 'icon ' => '#3b82f6 ' ,
133+ 'icon ' => '#3b82f6 ' ,
131134 ],
132135 ]);
136+
133137 return $ this ;
134138 }
135139}
0 commit comments