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
This commit is contained in:
2026-09-07 01:00:09 +03:30
parent 46ae711a20
commit 936f789ac8
38 changed files with 756 additions and 39 deletions

View File

@@ -46,7 +46,9 @@ class TemplateForm
->label('تصویر بندانگشتی')
->disk('public')
->directory('templates/thumbnails')
->image(),
->visibility('public')
->image()
->imageEditor(),
Toggle::make('is_active')
->label('فعال')
->default(true),

View File

@@ -0,0 +1,58 @@
<?php
namespace App\Filament\Resources\Templates\Schemas;
use Filament\Infolists\Components\IconEntry;
use Filament\Infolists\Components\ImageEntry;
use Filament\Infolists\Components\TextEntry;
use Filament\Schemas\Schema;
class TemplateInfolist
{
public static function configure(Schema $schema): Schema
{
return $schema
->components([
ImageEntry::make('thumbnail_path')
->label('تصویر بندانگشتی')
->disk('public')
->visibility('public')
->height(180)
->placeholder('بدون تصویر')
->columnSpanFull(),
TextEntry::make('title')
->label('عنوان'),
TextEntry::make('slug')
->label('شناسه')
->copyable(),
TextEntry::make('category.name')
->label('دسته‌بندی')
->placeholder('—'),
TextEntry::make('description')
->label('توضیحات')
->placeholder('—')
->columnSpanFull(),
IconEntry::make('is_active')
->label('فعال')
->boolean(),
IconEntry::make('is_ai_enabled')
->label('ساخت با هوش مصنوعی')
->boolean(),
TextEntry::make('ai_repeatable_slide_number')
->label('شماره اسلاید تکرارشونده')
->placeholder('—'),
TextEntry::make('generations_count')
->label('تعداد تولیدها')
->state(fn ($record): int => $record->generations()->count()),
TextEntry::make('creator.name')
->label('ایجادکننده')
->placeholder('—'),
TextEntry::make('created_at')
->label('تاریخ ایجاد')
->jalaliDateTime(),
TextEntry::make('updated_at')
->label('آخرین بروزرسانی')
->jalaliDateTime(),
]);
}
}