schema([ Section::make([ Group::make() ->schema([ TextInput::make('kode') ->label('Kode Promo'), Select::make('tipe') ->label('Tipe Promo') ->options(['fix'=>'Fix','persen'=>'Persentase']), TextInput::make('diskon'), ]), Toggle::make('aktif') ->default(true), ]) ]); } public static function table(Table $table): Table { return $table ->columns([ TextColumn::make('kode') ->label('Kode Promo'), TextColumn::make('tipe') ->label('Tipe Promo'), TextColumn::make('diskon'), BadgeColumn::make('aktif') ->label('Status') ->formatStateUsing(fn ($state) => $state ? 'Aktif' : 'Nonaktif') ->colors([ 'success' => fn ($state): bool => $state, // Warna hijau jika aktif 'danger' => fn ($state): bool => !$state // Warna merah jika nonaktif ]) ]) ->filters([ // ]) ->actions([ Tables\Actions\EditAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]); } public static function getRelations(): array { return [ // ]; } public static function getPages(): array { return [ 'index' => Pages\ListPromos::route('/'), 'create' => Pages\CreatePromo::route('/create'), 'edit' => Pages\EditPromo::route('/{record}/edit'), ]; } }