components([ Section::make('Rank Informatie') ->schema([ TextInput::make('name') ->autofocus() ->maxLength(255) ->required() ->label('Naam'), TextInput::make('description') ->maxLength(255) ->label('Beschrijving'), TextInput::make('badge_code') ->maxLength(255) ->label('Badge Code'), ]), Section::make('Sollicitatie Instellingen') ->schema([ Toggle::make('accepts_applications') ->label('Accepteert Sollicitaties') ->helperText('Zet aan als je wilt dat mensen voor deze rank kunnen solliciteren') ->live(), Select::make('application_rank') ->label('Sollicitatie Type') ->options([ 'all' => 'Alle Ranks', 'proef_dj' => 'Alleen Proef DJ', 'dj' => 'Alleen DJ', 'hoofd_dj' => 'Alleen Hoofd DJ', ]) ->helperText('Selecteer voor welke rank mensen mogen solliciteren') ->visible(fn ($get) => $get('accepts_applications')) ->required(fn ($get) => $get('accepts_applications')), ]), ]); } #[\Override] public static function table(Table $table): Table { return $table ->defaultSort('id', 'desc') ->columns([ TextColumn::make('id') ->label('ID'), TextColumn::make('name') ->label('Naam'), TextColumn::make('description') ->label('Beschrijving'), TextColumn::make('badge_code') ->label('Badge Code'), IconColumn::make('accepts_applications') ->label('Sollicitaties') ->boolean() ->trueIcon('heroicon-o-check-circle') ->falseIcon('heroicon-o-x-circle') ->trueColor('success') ->falseColor('danger'), TextColumn::make('application_rank') ->label('Type') ->badge() ->formatStateUsing(fn (string $state): string => match ($state) { 'all' => 'Alle', 'proef_dj' => 'Proef DJ', 'dj' => 'DJ', 'hoofd_dj' => 'Hoofd DJ', default => $state, }) ->color(fn (string $state): string => match ($state) { 'all' => 'gray', 'proef_dj' => 'info', 'dj' => 'warning', 'hoofd_dj' => 'success', default => 'gray', }), ]) ->filters([ // ]) ->actions([ EditAction::make(), ]) ->headerActions([ DeleteBulkAction::make(), ]); } #[\Override] public static function getRelations(): array { return [ // ]; } #[\Override] public static function getPages(): array { return [ 'index' => Pages\ListRadioRanks::route('/'), 'create' => Pages\CreateRadioRank::route('/create'), 'edit' => Pages\EditRadioRank::route('/{record}/edit'), ]; } }