33namespace Backstage \Filament \Users \Pages ;
44
55use BackedEnum ;
6- use Filament \Pages \Page ;
6+ use Backstage \Filament \Users \Models \User ;
7+ use Backstage \Filament \Users \Pages \RegisterFromInvitationPage \RedirectUrlAfterRegistration ;
78use Filament \Actions \Action ;
8- use Filament \Schemas \ Schema ;
9+ use Filament \Auth \ Events \ Registered ;
910use Filament \Facades \Filament ;
11+ use Filament \Forms \Components \TextInput ;
1012use Filament \Pages \Auth \Register ;
11- use Filament \Support \Enums \Width ;
13+ use Filament \Pages \Concerns \CanUseDatabaseTransactions ;
14+ use Filament \Pages \Concerns \InteractsWithFormActions ;
15+ use Filament \Pages \Page ;
16+ use Filament \Panel ;
17+ use Filament \Schemas \Components \Component ;
18+ use Filament \Schemas \Concerns \InteractsWithSchemas ;
19+ use Filament \Schemas \Contracts \HasSchemas ;
20+ use Filament \Schemas \Schema ;
1221use Filament \Support \Colors \Color ;
13- use Illuminate \Support \HtmlString ;
14- use Filament \Auth \Events \Registered ;
15- use Filament \Support \Enums \MaxWidth ;
16- use Filament \Support \Icons \Heroicon ;
17- use Illuminate \Support \Facades \Hash ;
18- use Filament \Schemas \Components \Form ;
19- use Filament \Schemas \Components \Grid ;
2022use Filament \Support \Enums \Alignment ;
23+ use Filament \Support \Enums \Width ;
24+ use Filament \Support \Icons \Heroicon ;
25+ use Illuminate \Contracts \Support \Htmlable ;
2126use Illuminate \Database \Eloquent \Model ;
22- use Filament \Forms \Components \TextInput ;
23- use Filament \Pages \Concerns \HasMaxWidth ;
24- use Backstage \Filament \Users \Models \User ;
27+ use Illuminate \Support \Facades \Hash ;
28+ use Illuminate \Support \HtmlString ;
2529use Illuminate \Validation \Rules \Password ;
26- use Filament \Schemas \Components \Component ;
27- use Filament \Schemas \Contracts \HasSchemas ;
28- use Illuminate \Contracts \Support \Htmlable ;
29- use Filament \Infolists \Components \TextEntry ;
30- use Filament \Schemas \Concerns \InteractsWithSchemas ;
31- use Filament \Pages \Concerns \InteractsWithFormActions ;
32- use Filament \Pages \Concerns \CanUseDatabaseTransactions ;
33- use Backstage \Filament \Users \Pages \RegisterFromInvitationPage \RedirectUrlAfterRegistration ;
34- use Filament \Panel ;
3530
3631class RegisterFromInvitationPage extends Page implements HasSchemas
3732{
@@ -98,12 +93,12 @@ protected function getLayoutData(): array
9893 ];
9994 }
10095
101- public function getMaxContentWidth (): Width | string | null
96+ public function getMaxContentWidth (): Width | string | null
10297 {
10398 return Width::TwoExtraLarge;
10499 }
105100
106- public static function getRouteMiddleware (Panel $ panel ): string | array
101+ public static function getRouteMiddleware (Panel $ panel ): string | array
107102 {
108103 return ['signed ' ];
109104 }
@@ -131,8 +126,8 @@ protected function getNameFormComponent(): Component
131126 return TextInput::make ('name ' )
132127 ->disabled ()
133128 ->hintAction ($ this ->getExplanationAction ())
134- ->prefixIcon (fn (): BackedEnum => Heroicon::OutlinedUserCircle, fn (): bool => true )
135- ->prefixIconColor (fn (): ?array => static ::getDefaultPanelColor ())
129+ ->prefixIcon (fn (): BackedEnum => Heroicon::OutlinedUserCircle, fn (): bool => true )
130+ ->prefixIconColor (fn (): ?array => static ::getDefaultPanelColor ())
136131 ->label (__ ('filament-panels::auth/pages/register.form.name.label ' ));
137132 }
138133
@@ -141,8 +136,8 @@ protected function getEmailFormComponent(): Component
141136 return TextInput::make ('email ' )
142137 ->disabled ()
143138 ->hintAction ($ this ->getExplanationAction ())
144- ->prefixIcon (fn (): BackedEnum => Heroicon::OutlinedEnvelope, fn (): bool => true )
145- ->prefixIconColor (fn (): ?array => static ::getDefaultPanelColor ())
139+ ->prefixIcon (fn (): BackedEnum => Heroicon::OutlinedEnvelope, fn (): bool => true )
140+ ->prefixIconColor (fn (): ?array => static ::getDefaultPanelColor ())
146141 ->label (__ ('filament-panels::auth/pages/register.form.email.label ' ));
147142 }
148143
@@ -154,11 +149,11 @@ protected function getPasswordFormComponent(): Component
154149 ->revealable (filament ()->arePasswordsRevealable ())
155150 ->required ()
156151 ->rule (Password::default ())
157- ->dehydrateStateUsing (fn ($ state ) => Hash::make ($ state ))
152+ ->dehydrateStateUsing (fn ($ state ) => Hash::make ($ state ))
158153 ->same ('passwordConfirmation ' )
159154 ->live ()
160- ->prefixIcon (fn (TextInput $ component ): BackedEnum => Heroicon::LockClosed, fn (): bool => true )
161- ->prefixIconColor (fn (): ?array => static ::getDefaultPanelColor ())
155+ ->prefixIcon (fn (TextInput $ component ): BackedEnum => Heroicon::LockClosed, fn (): bool => true )
156+ ->prefixIconColor (fn (): ?array => static ::getDefaultPanelColor ())
162157 ->validationAttribute (__ ('filament-panels::auth/pages/register.form.password.validation_attribute ' ));
163158 }
164159
@@ -172,17 +167,17 @@ protected function getPasswordConfirmationFormComponent(): Component
172167 ->rule (Password::default ())
173168 ->same ('password ' )
174169 ->live ()
175- ->prefixIcon (fn (TextInput $ component ): BackedEnum => Heroicon::LockClosed, fn (): bool => true )
176- ->prefixIconColor (fn (): ?array => static ::getDefaultPanelColor ())
170+ ->prefixIcon (fn (TextInput $ component ): BackedEnum => Heroicon::LockClosed, fn (): bool => true )
171+ ->prefixIconColor (fn (): ?array => static ::getDefaultPanelColor ())
177172 ->dehydrated (false );
178173 }
179174
180175 protected function getRegisterActionFormComponent (): Action
181176 {
182177 return Action::make ('hi ' )
183178 ->label (__ ('Register ' ))
184- ->color (fn (): ?array => static ::getDefaultPanelColor ())
185- ->action (fn () => $ this ->register ());
179+ ->color (fn (): ?array => static ::getDefaultPanelColor ())
180+ ->action (fn () => $ this ->register ());
186181 }
187182
188183 protected static function getDefaultPanelColor (): array
@@ -265,15 +260,15 @@ protected function getExplanationAction(): Action
265260 {
266261 return Action::make ('explanation ' )
267262 ->label (__ ('Explanation ' ))
268- ->icon (fn (): BackedEnum => Heroicon::OutlinedInformationCircle)
263+ ->icon (fn (): BackedEnum => Heroicon::OutlinedInformationCircle)
269264 ->color ('secondary ' )
270265 ->size ('sm ' )
271266 ->modal ()
272- ->modalWidth (fn (): Width => Width::TwoExtraLarge)
273- ->modalIcon (fn (): BackedEnum => Heroicon::InformationCircle)
267+ ->modalWidth (fn (): Width => Width::TwoExtraLarge)
268+ ->modalIcon (fn (): BackedEnum => Heroicon::InformationCircle)
274269 ->modalHeading (__ ('Explanation ' ))
275- ->modalDescription (fn (): ?Htmlable => new HtmlString (__ ('Information about the registration process. ' )))
276- ->modalContent (fn (): ?Htmlable => new HtmlString (__ (
270+ ->modalDescription (fn (): ?Htmlable => new HtmlString (__ ('Information about the registration process. ' )))
271+ ->modalContent (fn (): ?Htmlable => new HtmlString (__ (
277272 'You are registering as :userName with the email :email. This is because you were invited to join our platform. Your account will be created with the following details: <br> ' .
278273 '<strong>Name:</strong> :userName <br> ' .
279274 '<strong>Email:</strong> :email <br><br> ' ,
@@ -282,9 +277,9 @@ protected function getExplanationAction(): Action
282277 'email ' => $ this ->user ->email ,
283278 ]
284279 )))
285- ->modalContentFooter (fn (): ?Htmlable => new HtmlString (__ ('This can later be changed in your profile settings. ' )))
280+ ->modalContentFooter (fn (): ?Htmlable => new HtmlString (__ ('This can later be changed in your profile settings. ' )))
286281 ->modalFooterActionsAlignment (Alignment::Center)
287- ->modalCancelAction (fn (Action $ action ): Action => $ action ->label (__ ('Close ' )))
288- ->modalSubmitAction (fn (Action $ action ): Action => $ action ->hidden ());
282+ ->modalCancelAction (fn (Action $ action ): Action => $ action ->label (__ ('Close ' )))
283+ ->modalSubmitAction (fn (Action $ action ): Action => $ action ->hidden ());
289284 }
290285}
0 commit comments