schema([ Forms\Components\TextInput::make('name') ->label('Nama Mapel') ->required() ->maxLength(255), Forms\Components\Toggle::make('is_religious') ->label('Religious') ->required(), Forms\Components\Select::make('category') ->label('Kategori') ->options([ 'umum' => 'Umum', 'muatan lokal' => 'Muatan Lokal', 'seni' => 'Seni', ]) ->required(), ]); } public static function table(Table $table): Table { return $table ->columns([ Tables\Columns\TextColumn::make('name') ->label("Nama") ->searchable(), Tables\Columns\IconColumn::make('is_religious') ->label("Is Religious") ->boolean(), Tables\Columns\TextColumn::make('category') ->label("Kategori") ->sortable(), Tables\Columns\TextColumn::make('created_at') ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('deleted_at') // Add this column to show deleted timestamp ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), ]) ->filters([ Tables\Filters\TrashedFilter::make()->label('Tampilkan Data yang Dihapus'), ]) ->actions([ Tables\Actions\EditAction::make()->visible(fn () => auth()->user()->hasRole('admin')), Tables\Actions\DeleteAction::make()->visible(fn () => auth()->user()->hasRole('admin')), Tables\Actions\RestoreAction::make()->visible(fn (Subject $record) => auth()->user()->hasRole('admin') && $record->trashed()), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make()->visible(fn () => auth()->user()->hasRole('admin')), ]), ]); } public static function getRelations(): array { return [ // ]; } public static function getPages(): array { return [ 'index' => Pages\ListSubjects::route('/'), 'create' => Pages\CreateSubject::route('/create'), 'edit' => Pages\EditSubject::route('/{record}/edit'), ]; } public static function getNavigationLabel(): string { return 'Mata Pelajaran'; } public static function getBreadcrumb(): string { return 'Mata Pelajaran'; } public static function getPluralModelLabel(): string { return 'Mata Pelajaran'; } }