columns([ TextColumn::make('id') ->label('#') ->sortable() ->weight('bold') ->color('primary'), TextColumn::make('title') ->searchable() ->sortable() ->weight('semibold') ->limit(40), TextColumn::make('customer.name') ->searchable() ->sortable(), TextColumn::make('customerProduct.product.name') ->label('Product') ->placeholder('General') ->sortable() ->toggleable(), TextColumn::make('contract.type') ->label('Contract') ->badge() ->formatStateUsing(fn (?string $state): string => $state ? \App\Enums\ContractType::from($state)->label() : '-') ->color(fn (?string $state): string => match ($state) { 'sale' => 'success', 'lease' => 'info', 'bcc' => 'warning', default => 'gray', }) ->placeholder('-') ->toggleable(), TextColumn::make('feedbackChannel.name') ->label('Channel') ->badge() ->color('gray'), TextColumn::make('tags.name') ->badge() ->separator(',') ->toggleable(), TextColumn::make('status') ->badge() ->color(fn(string $state): string => match ($state) { 'pending' => 'warning', 'processing' => 'info', 'resolved' => 'success', 'closed' => 'gray', default => 'gray', }), TextColumn::make('currentDepartment.name') ->label('Department') ->badge() ->color('info') ->toggleable(), TextColumn::make('assignedTo.name') ->label('Assigned To') ->toggleable(), IconColumn::make('is_escalated') ->label('Escalated') ->boolean() ->toggleable(), TextColumn::make('created_at') ->label('Created') ->since() ->sortable() ->toggleable() ->color('secondary'), ]) ->filters([ SelectFilter::make('status') ->options([ 'pending' => 'Pending', 'processing' => 'Processing', 'resolved' => 'Resolved', 'closed' => 'Closed', ]), SelectFilter::make('feedback_channel_id') ->relationship('feedbackChannel', 'name') ->label('Channel'), SelectFilter::make('current_department_id') ->relationship('currentDepartment', 'name') ->label('Department'), SelectFilter::make('assigned_to') ->relationship('assignedTo', 'name') ->label('Assigned To'), ]) ->recordActions([ EditAction::make(), ]) ->toolbarActions([ BulkActionGroup::make([ DeleteBulkAction::make(), ]), ]) ->defaultSort('created_at', 'desc'); } }