nang cap san sang import
This commit is contained in:
67
app/Filament/Resources/Contracts/Tables/ContractsTable.php
Normal file
67
app/Filament/Resources/Contracts/Tables/ContractsTable.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Contracts\Tables;
|
||||
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class ContractsTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('id')
|
||||
->sortable(),
|
||||
TextColumn::make('product.name')
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('customer.name')
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('type')
|
||||
->badge()
|
||||
->formatStateUsing(fn (string $state): string => \App\Enums\ContractType::from($state)->label()),
|
||||
TextColumn::make('status')
|
||||
->badge()
|
||||
->color(fn (string $state): string => match ($state) {
|
||||
'active' => 'success',
|
||||
'expired' => 'warning',
|
||||
'liquidated' => 'danger',
|
||||
default => 'gray',
|
||||
})
|
||||
->formatStateUsing(fn (string $state): string => \App\Enums\ContractStatus::from($state)->label()),
|
||||
TextColumn::make('start_date')
|
||||
->date()
|
||||
->sortable()
|
||||
->toggleable(),
|
||||
TextColumn::make('end_date')
|
||||
->date()
|
||||
->sortable()
|
||||
->toggleable(),
|
||||
TextColumn::make('signed_status')
|
||||
->toggleable(),
|
||||
TextColumn::make('feedbacks_count')
|
||||
->counts('feedbacks')
|
||||
->label('Tickets'),
|
||||
TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user