22
33declare (strict_types=1 );
44
5- namespace App \Filament \Resources ;
6-
5+ namespace App \Filament \Resources \Appointments ;
6+
7+ use Filament \Pages \Enums \SubNavigationPosition ;
8+ use App \Filament \Resources \Appointments \Pages \ViewAppointment ;
9+ use App \Filament \Resources \Appointments \Pages \EditAppointment ;
10+ use Filament \Schemas \Schema ;
11+ use Filament \Actions \ViewAction ;
12+ use App \Filament \Resources \Appointments \Pages \CalendarAppointments ;
13+ use App \Filament \Resources \Appointments \Pages \ListAppointments ;
14+ use App \Filament \Resources \Appointments \Pages \CreateAppointment ;
715use App \Filament \Resources \AppointmentResource \Pages ;
8- use App \Filament \Resources \AppointmentResource \RelationManagers \ServicesRelationManager ;
9- use App \Filament \Resources \AppointmentResource \Schemas \AppointmentForm ;
10- use App \Filament \Resources \AppointmentResource \Schemas \AppointmentInfolist ;
16+ use App \Filament \Resources \Appointments \RelationManagers \ServicesRelationManager ;
17+ use App \Filament \Resources \Appointments \Schemas \AppointmentForm ;
18+ use App \Filament \Resources \Appointments \Schemas \AppointmentInfolist ;
1119use App \Models \Appointment ;
1220use App \Tables \Columns \TextColumn ;
13- use Filament \Forms \Form ;
14- use Filament \Infolists \Infolist ;
15- use Filament \Pages \SubNavigationPosition ;
1621use Filament \Resources \Pages \Page ;
1722use Filament \Resources \Resource ;
1823use Filament \Tables ;
@@ -25,16 +30,16 @@ class AppointmentResource extends Resource
2530
2631 protected static ?int $ navigationSort = 3 ;
2732
28- protected static ? string $ navigationIcon = 'heroicon-m-calendar-date-range ' ;
33+ protected static string | \ BackedEnum | null $ navigationIcon = 'heroicon-m-calendar-date-range ' ;
2934
30- protected static SubNavigationPosition $ subNavigationPosition = SubNavigationPosition::Start;
35+ protected static ? \ Filament \ Pages \ Enums \ SubNavigationPosition $ subNavigationPosition = SubNavigationPosition::Start;
3136
3237 public static function getRecordSubNavigation (Page $ page ): array
3338 {
3439 return $ page ->generateNavigationItems ([
3540 // ...
36- Pages \ ViewAppointment::class,
37- Pages \ EditAppointment::class,
41+ ViewAppointment::class,
42+ EditAppointment::class,
3843 ]);
3944 }
4045
@@ -48,16 +53,16 @@ public static function getPluralModelLabel(): string
4853 return __ ('appointment.label.plural ' );
4954 }
5055
51- public static function form (Form $ form ): Form
56+ public static function form (Schema $ schema ): Schema
5257 {
53- return $ form
54- ->schema (AppointmentForm::getSchema ());
58+ return $ schema
59+ ->components (AppointmentForm::getSchema ());
5560 }
5661
57- public static function infolist (Infolist $ infolist ): Infolist
62+ public static function infolist (Schema $ schema ): Schema
5863 {
59- return $ infolist
60- ->schema (AppointmentInfolist::getSchema ());
64+ return $ schema
65+ ->components (AppointmentInfolist::getSchema ());
6166 }
6267
6368 public static function table (Table $ table ): Table
@@ -126,11 +131,11 @@ public static function table(Table $table): Table
126131 ->placeholder (__ ('placeholder.all_beneficiaries ' ))
127132 ->multiple (),
128133 ])
129- ->actions ([
130- Tables \ Actions \ ViewAction::make ()
134+ ->recordActions ([
135+ ViewAction::make ()
131136 ->iconButton (),
132137 ])
133- ->bulkActions ([
138+ ->toolbarActions ([
134139 //
135140 ])
136141 ->defaultSort ('id ' , 'desc ' );
@@ -146,11 +151,11 @@ public static function getRelations(): array
146151 public static function getPages (): array
147152 {
148153 return [
149- 'index ' => Pages \ CalendarAppointments::route ('/ ' ),
150- 'list ' => Pages \ ListAppointments::route ('/list ' ),
151- 'create ' => Pages \ CreateAppointment::route ('/create/{beneficiary?} ' ),
152- 'view ' => Pages \ ViewAppointment::route ('/{record} ' ),
153- 'edit ' => Pages \ EditAppointment::route ('/{record}/edit ' ),
154+ 'index ' => CalendarAppointments::route ('/ ' ),
155+ 'list ' => ListAppointments::route ('/list ' ),
156+ 'create ' => CreateAppointment::route ('/create/{beneficiary?} ' ),
157+ 'view ' => ViewAppointment::route ('/{record} ' ),
158+ 'edit ' => EditAppointment::route ('/{record}/edit ' ),
154159 ];
155160 }
156161}
0 commit comments