1010use Filament \Actions \EditAction ;
1111use Filament \Forms \Components \Select ;
1212use Filament \Forms \Components \TextInput ;
13+ use Filament \Forms \Components \Toggle ;
1314use Filament \Resources \RelationManagers \RelationManager ;
1415use Filament \Schemas \Schema ;
16+ use Filament \Tables \Columns \IconColumn ;
1517use Filament \Tables \Columns \TextColumn ;
1618use Filament \Tables \Table ;
1719
@@ -27,12 +29,17 @@ public function form(Schema $schema): Schema
2729 return $ schema
2830 ->components ([
2931 TextInput::make ('name ' )
30- ->required (),
32+ ->required ()
33+ ->label ('Internal Name ' )
34+ ->columnSpanFull (),
3135 TextInput::make ('cost ' )
3236 ->required ()
3337 ->suffix (config ('billing.currency ' ))
3438 ->numeric ()
3539 ->minValue (0 ),
40+ Toggle::make ('renewable ' )
41+ ->label ('Can be renewed? ' )
42+ ->inline (false ),
3643 Select::make ('interval_type ' )
3744 ->required ()
3845 ->selectablePlaceholder (false )
@@ -49,10 +56,14 @@ public function table(Table $table): Table
4956 return $ table
5057 ->columns ([
5158 TextColumn::make ('name ' )
59+ ->label ('Internal Name ' )
5260 ->sortable (),
5361 TextColumn::make ('cost ' )
5462 ->sortable ()
5563 ->state (fn (ProductPrice $ price ) => $ price ->formatCost ()),
64+ IconColumn::make ('renewable ' )
65+ ->label ('Can be renewed? ' )
66+ ->boolean (),
5667 TextColumn::make ('interval ' )
5768 ->state (fn (ProductPrice $ price ) => $ price ->interval_value . ' ' . $ price ->interval_type ->name ),
5869 ])
0 commit comments