22
33namespace App \Filament \Resources ;
44
5- use App \Filament \Resources \AppResource \Pages ;
5+ use App \Filament \Resources \AppResource \Pages \CreateApp ;
6+ use App \Filament \Resources \AppResource \Pages \EditApp ;
7+ use App \Filament \Resources \AppResource \Pages \ListApps ;
68use App \Filament \Resources \AppResource \RelationManagers \GroupsRelationManager ;
79use App \Models \App ;
810use App \Services \Hydra \Client ;
9- use Filament \Forms \Components \Card ;
1011use Filament \Forms \Components \Checkbox ;
1112use Filament \Forms \Components \CheckboxList ;
1213use Filament \Forms \Components \DateTimePicker ;
13- use Filament \Forms \Components \Group ;
1414use Filament \Forms \Components \Placeholder ;
15- use Filament \Forms \Components \Section ;
1615use Filament \Forms \Components \Select ;
17- use Filament \Forms \Components \Tabs ;
1816use Filament \Forms \Components \TagsInput ;
1917use Filament \Forms \Components \TextInput ;
20- use Filament \Forms \Form ;
2118use Filament \Resources \Resource ;
19+ use Filament \Schemas \Components \Group ;
20+ use Filament \Schemas \Components \Section ;
21+ use Filament \Schemas \Components \Tabs ;
22+ use Filament \Schemas \Components \Tabs \Tab ;
23+ use Filament \Schemas \Schema ;
2224use Filament \Tables \Columns \TextColumn ;
2325use Filament \Tables \Table ;
2426
@@ -30,20 +32,20 @@ class AppResource extends Resource
3032
3133 protected static ?string $ recordTitleAttribute = 'client_id ' ;
3234
33- protected static ? string $ navigationIcon = 'heroicon-o-rectangle-stack ' ;
35+ protected static string | \ BackedEnum | null $ navigationIcon = 'heroicon-o-rectangle-stack ' ;
3436
35- public static function form (Form $ form ): Form
37+ public static function form (Schema $ schema ): Schema
3638 {
37- return $ form
38- ->schema ([
39+ return $ schema
40+ ->components ([
3941 Group::make ()->columnSpan (2 )->schema ([
4042 Group::make ()->columns ()->schema ([
4143 TextInput::make ('client_id ' )->label ('Client ID ' )->disabled (),
4244 TextInput::make ('data.client_secret ' )->disabled (),
4345 TextInput::make ('data.client_name ' )->columnSpan (2 )->required (),
4446 ]),
4547 Tabs::make ('Tabs ' )->tabs ([
46- Tabs \ Tab::make ('Information ' )->icon ('heroicon-o-paper-clip ' )->schema ([
48+ Tab::make ('Information ' )->icon ('heroicon-o-paper-clip ' )->schema ([
4749 TextInput::make ('data.client_uri ' )
4850 ->url ()
4951 ->helperText ('A URL string of a web page providing information about the client ' ),
@@ -57,7 +59,7 @@ public static function form(Form $form): Form
5759 ->url ()
5860 ->helperText ('A URL string that references the terms of service for the client ' ),
5961 ]),
60- Tabs \ Tab::make ('Login ' )->icon ('heroicon-o-arrow-left-on-rectangle ' )->schema ([
62+ Tab::make ('Login ' )->icon ('heroicon-o-arrow-left-on-rectangle ' )->schema ([
6163 TagsInput::make ('data.redirect_uris ' )->columnSpan (2 ),
6264 Select::make ('data.subject_type ' )->options ([
6365 'public ' => 'public ' ,
@@ -75,7 +77,7 @@ public static function form(Form $form): Form
7577 'token ' => 'token ' ,
7678 ])->columnSpan (2 ),
7779 ]),
78- Tabs \ Tab::make ('Token ' )->icon ('heroicon-o-lock-closed ' )->schema ([
80+ Tab::make ('Token ' )->icon ('heroicon-o-lock-closed ' )->schema ([
7981 Select::make ('data.token_endpoint_auth_method ' )->options ([
8082 'client_secret_post ' => 'client_secret_post ' ,
8183 'client_secret_basic ' => 'client_secret_basic ' ,
@@ -96,7 +98,7 @@ public static function form(Form $form): Form
9698 }),
9799
98100 ]),
99- Tabs \ Tab::make ('Logout ' )->icon ('heroicon-o-arrow-right-on-rectangle ' )->schema ([
101+ Tab::make ('Logout ' )->icon ('heroicon-o-arrow-right-on-rectangle ' )->schema ([
100102 TagsInput::make ('data.post_logout_redirect_uris ' )->columnSpan (2 ),
101103 Section::make ('Frontchannel Logout ' )
102104 ->description ('Configure frontchannel logout. ' )
@@ -119,7 +121,7 @@ public static function form(Form $form): Form
119121 ]),
120122 ]),
121123
122- Tabs \ Tab::make ('Request ' )->icon ('heroicon-o-signal ' )->schema ([
124+ Tab::make ('Request ' )->icon ('heroicon-o-signal ' )->schema ([
123125 TagsInput::make ('data.request_uris ' )->columnSpan (2 ),
124126 Select::make ('data.request_object_signing_alg ' )->options ([
125127 'none ' => 'none ' ,
@@ -128,11 +130,11 @@ public static function form(Form $form): Form
128130 ])->columnSpan (2 ),
129131 ]),
130132
131- Tabs \ Tab::make ('CORS ' )->icon ('heroicon-o-globe-alt ' )->schema ([
133+ Tab::make ('CORS ' )->icon ('heroicon-o-globe-alt ' )->schema ([
132134 TagsInput::make ('data.allowed_cors_origins ' )->columnSpan (2 ),
133135 ]),
134136
135- Tabs \ Tab::make ('Audience ' )->schema ([
137+ Tab::make ('Audience ' )->schema ([
136138 TagsInput::make ('data.audience ' )->columnSpan (1 ),
137139 ]),
138140 ]),
@@ -168,7 +170,7 @@ public static function form(Form $form): Form
168170 })->hint ('Request new Icons @ Thiritin ' )->required (),
169171 TextInput::make ('url ' )->url (),
170172 ]),
171- Card ::make ()->schema ([
173+ Section ::make ()->schema ([
172174 Placeholder::make ('created_at ' )
173175 ->label ('Created At ' )
174176 ->content (fn (?App $ record ): string => $ record ?->created_at?->diffForHumans() ?? '- ' ),
@@ -195,9 +197,9 @@ public static function table(Table $table): Table
195197 public static function getPages (): array
196198 {
197199 return [
198- 'index ' => Pages \ ListApps::route ('/ ' ),
199- 'create ' => Pages \ CreateApp::route ('/create ' ),
200- 'edit ' => Pages \ EditApp::route ('/{record}/edit ' ),
200+ 'index ' => ListApps::route ('/ ' ),
201+ 'create ' => CreateApp::route ('/create ' ),
202+ 'edit ' => EditApp::route ('/{record}/edit ' ),
201203 ];
202204 }
203205
0 commit comments