columns([ ImageColumn::make('cover_image') ->label(__('music_productions.cover_image_field')) ->getStateUsing(fn (MusicProduction $record): ?string => $record->cover_image_url) ->square() ->size(60), TextColumn::make('title') ->label(__('music_productions.table_title')) ->searchable() ->sortable() ->limit(50), TextColumn::make('slug') ->label(__('music_productions.table_slug')) ->searchable() ->sortable() ->limit(30), TextColumn::make('client_name') ->label(__('music_productions.table_client_name')) ->searchable() ->sortable() ->limit(30), TextColumn::make('production_date') ->label(__('music_productions.table_production_date')) ->date('d.m.Y') ->sortable(), TextColumn::make('spotify_type') ->label(__('music_productions.spotify_type_field')) ->badge() ->formatStateUsing(fn (?string $state): string => filled($state) ? __('music_productions.spotify_type_' . $state, [], $state) : '-') ->color(fn (?string $state): string => match ($state) { 'single' => 'info', 'album' => 'success', default => 'gray', }) ->toggleable(), ToggleColumn::make('is_active') ->label(__('music_productions.table_is_active')) ->alignCenter(), TextColumn::make('sort_order') ->label(__('music_productions.sort_order_field')) ->sortable() ->alignCenter(), TextColumn::make('created_at') ->label(__('music_productions.table_created_at')) ->dateTime('d.m.Y H:i') ->sortable() ->toggleable(isToggledHiddenByDefault: true), TextColumn::make('updated_at') ->label(__('music_productions.table_updated_at')) ->dateTime('d.m.Y H:i') ->sortable() ->toggleable(isToggledHiddenByDefault: true), ]) ->filters([ TernaryFilter::make('is_active') ->label(__('music_productions.is_active_field')), ]) ->recordActions([ EditAction::make() ->label(__('music_productions.edit')), ]) ->toolbarActions([ BulkActionGroup::make([ DeleteBulkAction::make() ->label(__('music_productions.delete')), RestoreBulkAction::make() ->label(__('music_productions.restore')), ForceDeleteBulkAction::make() ->label(__('music_productions.force_delete')), ]), ]) ->defaultSort('sort_order', 'asc'); } }