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:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\Users\Schemas;
|
||||
|
||||
use App\Support\Mobile;
|
||||
use Filament\Forms\Components\CheckboxList;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Schema;
|
||||
@@ -25,6 +26,13 @@ class UserForm
|
||||
TextInput::make('mobile')
|
||||
->label('شماره موبایل')
|
||||
->tel()
|
||||
->helperText('مثال درست: 09123456789')
|
||||
->dehydrateStateUsing(fn (?string $state): ?string => Mobile::normalize($state))
|
||||
->rules([static function (string $attribute, mixed $value, \Closure $fail): void {
|
||||
if (filled($value) && ! preg_match(Mobile::REGEX, (string) Mobile::normalize((string) $value))) {
|
||||
$fail('فرمت شماره موبایل صحیح نیست. مثال درست: 09123456789');
|
||||
}
|
||||
}])
|
||||
->unique(ignoreRecord: true)
|
||||
->maxLength(20),
|
||||
TextInput::make('password')
|
||||
|
||||
@@ -33,7 +33,7 @@ class UsersTable
|
||||
->searchable(),
|
||||
TextColumn::make('created_at')
|
||||
->label('تاریخ ایجاد')
|
||||
->dateTime()
|
||||
->jalaliDateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user