- lang/fa: add validation/auth/passwords/pagination translations so admin and API validation errors are in Persian - templates: soft-delete instead of cascade-deleting their generations; keep resolving trashed template on generations (labels/downloads) - templates: add TemplateInfolist with a real thumbnail ImageEntry - generations: auto-name template-based generations and use that name for the download file and as a searchable column - admin: show all dates as Jalali via ->jalaliDate()/->jalaliDateTime() Filament macros (App\Support\Jalali) - wallets: harden the deposit/withdraw action to surface the exact error instead of a 500 - profile: normalize Iranian mobile numbers (App\Support\Mobile), add social_links, coerce notification-preference booleans, require the current password to delete an account Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013P66ea1dC5CVM9t29496t5
64 lines
2.2 KiB
PHP
64 lines
2.2 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\AiProviders\Tables;
|
|
|
|
use App\Enums\AiProviderDriver;
|
|
use Filament\Actions\BulkActionGroup;
|
|
use Filament\Actions\DeleteBulkAction;
|
|
use Filament\Actions\EditAction;
|
|
use Filament\Tables\Columns\IconColumn;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Filters\TernaryFilter;
|
|
use Filament\Tables\Table;
|
|
|
|
class AiProvidersTable
|
|
{
|
|
public static function configure(Table $table): Table
|
|
{
|
|
return $table
|
|
->columns([
|
|
TextColumn::make('name')
|
|
->label('نام')
|
|
->searchable()
|
|
->sortable(),
|
|
TextColumn::make('driver')
|
|
->label('سرویسدهنده')
|
|
->badge()
|
|
->formatStateUsing(fn (AiProviderDriver $state): string => $state->label()),
|
|
TextColumn::make('model')
|
|
->label('مدل')
|
|
->searchable(),
|
|
TextColumn::make('base_url')
|
|
->label('آدرس API')
|
|
->formatStateUsing(fn (?string $state, $record): string => $state ?: $record->driver->defaultBaseUrl())
|
|
->toggleable(),
|
|
IconColumn::make('is_active')
|
|
->label('فعال')
|
|
->boolean(),
|
|
IconColumn::make('is_default')
|
|
->label('پیشفرض')
|
|
->boolean(),
|
|
TextColumn::make('created_at')
|
|
->label('تاریخ ایجاد')
|
|
->jalaliDateTime()
|
|
->sortable()
|
|
->toggleable(isToggledHiddenByDefault: true),
|
|
])
|
|
->filters([
|
|
TernaryFilter::make('is_active')
|
|
->label('وضعیت')
|
|
->placeholder('همه')
|
|
->trueLabel('فعال')
|
|
->falseLabel('غیرفعال'),
|
|
])
|
|
->recordActions([
|
|
EditAction::make(),
|
|
])
|
|
->toolbarActions([
|
|
BulkActionGroup::make([
|
|
DeleteBulkAction::make(),
|
|
]),
|
|
]);
|
|
}
|
|
}
|