Hoan thien core finance v2 - Calculation Pipeline, Form Templates
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\FormTemplates\Tables;
|
||||
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class FormTemplatesTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('name')
|
||||
->label('Tên biểu mẫu')
|
||||
->searchable()
|
||||
->sortable(),
|
||||
|
||||
Tables\Columns\TextColumn::make('code')
|
||||
->label('Mã')
|
||||
->searchable()
|
||||
->copyable(),
|
||||
|
||||
Tables\Columns\TextColumn::make('target_model')
|
||||
->label('Áp dụng cho')
|
||||
->formatStateUsing(fn ($state) => match ($state) {
|
||||
'App\Models\Contract' => 'Hợp đồng',
|
||||
'App\Models\Product' => 'Sản phẩm',
|
||||
'App\Models\Customer' => 'Khách hàng',
|
||||
default => $state,
|
||||
}),
|
||||
|
||||
Tables\Columns\TextColumn::make('paper_size')
|
||||
->label('Khổ giấy')
|
||||
->badge(),
|
||||
|
||||
Tables\Columns\IconColumn::make('is_active')
|
||||
->label('Hoạt động')
|
||||
->boolean(),
|
||||
|
||||
Tables\Columns\TextColumn::make('fields_count')
|
||||
->label('Số trường')
|
||||
->counts('fields'),
|
||||
])
|
||||
->filters([
|
||||
Tables\Filters\SelectFilter::make('target_model')
|
||||
->label('Áp dụng cho')
|
||||
->options([
|
||||
'App\Models\Contract' => 'Hợp đồng',
|
||||
'App\Models\Product' => 'Sản phẩm',
|
||||
'App\Models\Customer' => 'Khách hàng',
|
||||
]),
|
||||
])
|
||||
->defaultSort('name');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user