44 lines
1.2 KiB
PHP
44 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Coupons\Tables;
|
|
|
|
use App\Filament\Tables\Filters\CreatedAtDateFilter;
|
|
use Filament\Actions\ViewAction;
|
|
use Filament\Actions\DeleteAction;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Table;
|
|
|
|
class CouponsTable
|
|
{
|
|
public static function configure(Table $table): Table
|
|
{
|
|
return $table
|
|
->defaultSort('created_at', 'desc')
|
|
->columns([
|
|
TextColumn::make('id')
|
|
->sortable(),
|
|
TextColumn::make('phone')
|
|
->searchable()
|
|
->sortable()
|
|
->copyable(),
|
|
TextColumn::make('code')
|
|
->sortable()
|
|
->copyable(),
|
|
TextColumn::make('created_at')
|
|
->dateTime()
|
|
->sortable(),
|
|
TextColumn::make('updated_at')
|
|
->dateTime()
|
|
->sortable()
|
|
->toggleable(isToggledHiddenByDefault: true),
|
|
])
|
|
->filters([
|
|
CreatedAtDateFilter::make(),
|
|
])
|
|
->recordActions([
|
|
ViewAction::make(),
|
|
DeleteAction::make(),
|
|
]);
|
|
}
|
|
}
|