- Departments + cross-department transfer workflow - Role-based closing (staff→resolved, manager→closed) with proof_of_resolution - Private file storage with collection system + temporary signed URLs - Dashboard: resolved tickets table, stats, handler performance bar chart - Spatie RBAC (admin/manager/staff) - Notifications: TicketTransferred, TicketClosed (database + mail) - Pest tests: 8 tests, 21 assertions - Docker production-ready (Dockerfile + compose + entrypoint)
64 lines
2.3 KiB
PHP
64 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Customers\RelationManagers;
|
|
|
|
use App\Filament\Resources\Feedback\FeedbackResource;
|
|
use Filament\Resources\RelationManagers\RelationManager;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Filters\SelectFilter;
|
|
use Filament\Tables\Table;
|
|
|
|
class FeedbacksRelationManager extends RelationManager
|
|
{
|
|
protected static string $relationship = 'feedbacks';
|
|
|
|
protected static ?string $title = 'Feedback History';
|
|
|
|
public function table(Table $table): Table
|
|
{
|
|
return $table
|
|
->recordTitleAttribute('title')
|
|
->columns([
|
|
TextColumn::make('title')
|
|
->searchable()
|
|
->url(fn ($record) => FeedbackResource::getUrl('edit', ['record' => $record])),
|
|
TextColumn::make('customerProduct.product.name')
|
|
->label('Product')
|
|
->placeholder('General'),
|
|
TextColumn::make('status')
|
|
->badge()
|
|
->color(fn (string $state): string => match ($state) {
|
|
'pending' => 'warning',
|
|
'processing' => 'info',
|
|
'resolved' => 'success',
|
|
'closed' => 'gray',
|
|
default => 'gray',
|
|
}),
|
|
TextColumn::make('tags.name')
|
|
->badge(),
|
|
TextColumn::make('feedbackChannel.name')
|
|
->label('Channel'),
|
|
TextColumn::make('interactions_count')
|
|
->counts('interactions')
|
|
->label('Interactions'),
|
|
TextColumn::make('created_at')
|
|
->dateTime('d/m/Y')
|
|
->sortable(),
|
|
])
|
|
->filters([
|
|
SelectFilter::make('status')
|
|
->options([
|
|
'pending' => 'Pending',
|
|
'processing' => 'Processing',
|
|
'resolved' => 'Resolved',
|
|
'closed' => 'Closed',
|
|
]),
|
|
SelectFilter::make('tags')
|
|
->relationship('tags', 'name'),
|
|
])
|
|
->defaultSort('created_at', 'desc')
|
|
->headerActions([])
|
|
->recordActions([]);
|
|
}
|
|
}
|