Files
hoshpoint-backend/app/Filament/Resources/TemplateGenerations/Schemas/TemplateGenerationInfolist.php
soheil khaledabadi 936f789ac8 feat: Persian panel/API fixes and structural-model tweaks
- 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
2026-09-07 01:00:09 +03:30

53 lines
2.1 KiB
PHP

<?php
namespace App\Filament\Resources\TemplateGenerations\Schemas;
use App\Enums\TemplateGenerationStatus;
use Filament\Infolists\Components\KeyValueEntry;
use Filament\Infolists\Components\TextEntry;
use Filament\Schemas\Schema;
class TemplateGenerationInfolist
{
public static function configure(Schema $schema): Schema
{
return $schema
->components([
TextEntry::make('title')
->label('نام فایل')
->placeholder('—')
->columnSpanFull(),
TextEntry::make('uuid')
->label('شناسه')
->copyable(),
TextEntry::make('template.title')
->label('قالب'),
TextEntry::make('status')
->label('وضعیت')
->badge()
->formatStateUsing(fn (TemplateGenerationStatus $state): string => $state->label())
->color(fn (TemplateGenerationStatus $state): string => match ($state) {
TemplateGenerationStatus::Pending => 'gray',
TemplateGenerationStatus::Processing => 'warning',
TemplateGenerationStatus::Completed => 'success',
TemplateGenerationStatus::Failed => 'danger',
}),
TextEntry::make('requester.name')
->label('درخواست‌دهنده')
->placeholder('—'),
TextEntry::make('error_message')
->label('پیام خطا')
->placeholder('—')
->columnSpanFull(),
KeyValueEntry::make('values')
->label('محتوای ذخیره‌شده (از جمله متن‌های تولیدشده با هوش مصنوعی)')
->keyLabel('کلید')
->valueLabel('مقدار')
->columnSpanFull(),
TextEntry::make('created_at')
->label('تاریخ ایجاد')
->jalaliDateTime(),
]);
}
}