- 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
77 lines
2.7 KiB
PHP
77 lines
2.7 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Templates\Tables;
|
|
|
|
use App\Filament\Resources\Templates\Actions\GenerateWithAiAction;
|
|
use Filament\Actions\BulkActionGroup;
|
|
use Filament\Actions\DeleteAction;
|
|
use Filament\Actions\DeleteBulkAction;
|
|
use Filament\Actions\EditAction;
|
|
use Filament\Actions\ForceDeleteAction;
|
|
use Filament\Actions\ForceDeleteBulkAction;
|
|
use Filament\Actions\RestoreAction;
|
|
use Filament\Actions\RestoreBulkAction;
|
|
use Filament\Actions\ViewAction;
|
|
use Filament\Tables\Columns\IconColumn;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Filters\SelectFilter;
|
|
use Filament\Tables\Filters\TernaryFilter;
|
|
use Filament\Tables\Filters\TrashedFilter;
|
|
use Filament\Tables\Table;
|
|
|
|
class TemplatesTable
|
|
{
|
|
public static function configure(Table $table): Table
|
|
{
|
|
return $table
|
|
->columns([
|
|
TextColumn::make('title')
|
|
->label('عنوان')
|
|
->searchable()
|
|
->sortable(),
|
|
TextColumn::make('category.name')
|
|
->label('دستهبندی')
|
|
->searchable()
|
|
->sortable(),
|
|
TextColumn::make('keys_count')
|
|
->label('تعداد کلیدها')
|
|
->counts('keys'),
|
|
IconColumn::make('is_active')
|
|
->label('فعال')
|
|
->boolean(),
|
|
TextColumn::make('created_at')
|
|
->label('تاریخ ایجاد')
|
|
->jalaliDateTime()
|
|
->sortable()
|
|
->toggleable(isToggledHiddenByDefault: true),
|
|
])
|
|
->filters([
|
|
SelectFilter::make('category_id')
|
|
->label('دستهبندی')
|
|
->relationship('category', 'name'),
|
|
TernaryFilter::make('is_active')
|
|
->label('وضعیت')
|
|
->placeholder('همه')
|
|
->trueLabel('فعال')
|
|
->falseLabel('غیرفعال'),
|
|
TrashedFilter::make()
|
|
->label('وضعیت حذف'),
|
|
])
|
|
->recordActions([
|
|
ViewAction::make(),
|
|
EditAction::make(),
|
|
GenerateWithAiAction::make(),
|
|
DeleteAction::make(),
|
|
RestoreAction::make(),
|
|
ForceDeleteAction::make(),
|
|
])
|
|
->toolbarActions([
|
|
BulkActionGroup::make([
|
|
DeleteBulkAction::make(),
|
|
RestoreBulkAction::make(),
|
|
ForceDeleteBulkAction::make(),
|
|
]),
|
|
]);
|
|
}
|
|
}
|