feat: add form request validation classes

This commit is contained in:
2026-08-17 07:46:37 +03:30
parent 8372e20182
commit a2f1b04c97
7 changed files with 376 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace App\Enums;
enum PaymentStatus: int
{
case Pending = 0;
case Success = 1;
case Failed = 2;
case Canceled = 3;
// برچسب فارسی برای نمایش در ویو
public function label(): string
{
return match ($this) {
self::Pending => 'در انتظار پرداخت',
self::Success => 'پرداخت موفق',
self::Failed => 'پرداخت ناموفق',
self::Canceled => 'لغو شده / بازگشت وجه',
};
}
// کلاس رنگ برای بج (بدج) در جدول
public function color(): string
{
return match ($this) {
self::Pending => 'warning',
self::Success => 'success',
self::Failed => 'danger',
self::Canceled => 'secondary',
};
}
}