22
33namespace Tapp \FilamentWebhookClient \Resources ;
44
5+ use Filament \Schemas \Schema ;
6+ use Filament \Infolists \Components \TextEntry ;
7+ use Filament \Infolists \Components \ViewEntry ;
8+ use Filament \Forms \Components \TextInput ;
9+ use Filament \Forms \Components \Textarea ;
10+ use Filament \Tables \Columns \TextColumn ;
11+ use Filament \Actions \ViewAction ;
12+ use Filament \Actions \BulkActionGroup ;
13+ use Filament \Actions \DeleteBulkAction ;
14+ use Tapp \FilamentWebhookClient \Resources \WebhookCallResource \Pages \ListWebhookCalls ;
15+ use Tapp \FilamentWebhookClient \Resources \WebhookCallResource \Pages \CreateWebhookCall ;
16+ use Tapp \FilamentWebhookClient \Resources \WebhookCallResource \Pages \EditWebhookCall ;
517use Filament \Forms ;
6- use Filament \Forms \Form ;
718use Filament \Infolists ;
8- use Filament \Infolists \Infolist ;
919use Filament \Resources \Resource ;
1020use Filament \Tables ;
1121use Filament \Tables \Table ;
@@ -41,41 +51,41 @@ public static function getPluralLabel(): string
4151 return __ ('filament-webhook-client::filament-webhook-client.navigation.plural-label ' );
4252 }
4353
44- public static function infolist (Infolist $ infolist ): Infolist
54+ public static function infolist (Schema $ schema ): Schema
4555 {
46- return $ infolist
47- ->schema ([
48- Infolists \ Components \ TextEntry::make ('id ' )
56+ return $ schema
57+ ->components ([
58+ TextEntry::make ('id ' )
4959 ->label ('ID ' ),
50- Infolists \ Components \ TextEntry::make ('name ' ),
51- Infolists \ Components \ TextEntry::make ('url ' ),
52- Infolists \ Components \ ViewEntry::make ('headers ' )
60+ TextEntry::make ('name ' ),
61+ TextEntry::make ('url ' ),
62+ ViewEntry::make ('headers ' )
5363 ->view ('filament-webhook-client::infolists.entries.formatted-json ' )
5464 ->columnSpanFull (),
55- Infolists \ Components \ ViewEntry::make ('payload ' )
65+ ViewEntry::make ('payload ' )
5666 ->view ('filament-webhook-client::infolists.entries.formatted-json ' )
5767 ->columnSpanFull (),
58- Infolists \ Components \ ViewEntry::make ('exception ' )
68+ ViewEntry::make ('exception ' )
5969 ->view ('filament-webhook-client::infolists.entries.formatted-json ' )
6070 ->columnSpanFull (),
6171 ]);
6272 }
6373
64- public static function form (Form $ form ): Form
74+ public static function form (Schema $ schema ): Schema
6575 {
66- return $ form
67- ->schema ([
68- Forms \ Components \ TextInput::make ('name ' )
76+ return $ schema
77+ ->components ([
78+ TextInput::make ('name ' )
6979 ->required ()
7080 ->maxLength (255 ),
71- Forms \ Components \ TextInput::make ('url ' )
81+ TextInput::make ('url ' )
7282 ->required ()
7383 ->maxLength (255 ),
74- Forms \ Components \ TextInput::make ('headers ' )
84+ TextInput::make ('headers ' )
7585 ->columnSpanFull (),
76- Forms \ Components \ Textarea::make ('payload ' )
86+ Textarea::make ('payload ' )
7787 ->columnSpanFull (),
78- Forms \ Components \ Textarea::make ('exception ' )
88+ Textarea::make ('exception ' )
7989 ->columnSpanFull (),
8090 ]);
8191 }
@@ -84,32 +94,32 @@ public static function table(Table $table): Table
8494 {
8595 return $ table
8696 ->columns ([
87- Tables \ Columns \ TextColumn::make ('name ' )
97+ TextColumn::make ('name ' )
8898 ->sortable ()
8999 ->searchable (),
90- Tables \ Columns \ TextColumn::make ('url ' )
100+ TextColumn::make ('url ' )
91101 ->sortable ()
92102 ->searchable (),
93- Tables \ Columns \ TextColumn::make ('created_at ' )
103+ TextColumn::make ('created_at ' )
94104 ->dateTime ()
95105 ->sortable ()
96106 ->toggleable (isToggledHiddenByDefault: true ),
97- Tables \ Columns \ TextColumn::make ('updated_at ' )
107+ TextColumn::make ('updated_at ' )
98108 ->dateTime ()
99109 ->sortable ()
100110 ->toggleable (isToggledHiddenByDefault: true ),
101111 ])
102112 ->filters ([
103113 //
104114 ])
105- ->actions ([
106- Tables \ Actions \ ViewAction::make ()
115+ ->recordActions ([
116+ ViewAction::make ()
107117 ->stickyModalFooter ()
108118 ->stickyModalHeader (),
109119 ])
110- ->bulkActions ([
111- Tables \ Actions \ BulkActionGroup::make ([
112- Tables \ Actions \ DeleteBulkAction::make (),
120+ ->toolbarActions ([
121+ BulkActionGroup::make ([
122+ DeleteBulkAction::make (),
113123 ]),
114124 ]);
115125 }
@@ -124,9 +134,9 @@ public static function getRelations(): array
124134 public static function getPages (): array
125135 {
126136 return [
127- 'index ' => Pages \ ListWebhookCalls::route ('/ ' ),
128- 'create ' => Pages \ CreateWebhookCall::route ('/create ' ),
129- 'edit ' => Pages \ EditWebhookCall::route ('/{record}/edit ' ),
137+ 'index ' => ListWebhookCalls::route ('/ ' ),
138+ 'create ' => CreateWebhookCall::route ('/create ' ),
139+ 'edit ' => EditWebhookCall::route ('/{record}/edit ' ),
130140 ];
131141 }
132142}
0 commit comments