42 lines
1.6 KiB
PHP
42 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Support;
|
|
|
|
class ConditionalOrderValidation
|
|
{
|
|
public static function messages(): array
|
|
{
|
|
return [
|
|
'required' => ':attribute الزامی است.',
|
|
'integer' => ':attribute باید عدد صحیح باشد.',
|
|
'numeric' => ':attribute باید عدد باشد.',
|
|
'min.numeric' => ':attribute نباید کمتر از :min باشد.',
|
|
'min.string' => ':attribute نباید کمتر از :min کاراکتر باشد.',
|
|
'max.string' => ':attribute نباید بیشتر از :max کاراکتر باشد.',
|
|
'in' => ':attribute انتخابشده نامعتبر است.',
|
|
'boolean' => ':attribute باید صحیح یا غلط باشد.',
|
|
'date' => ':attribute تاریخ معتبری نیست.',
|
|
'after' => ':attribute باید بعد از الان باشد.',
|
|
'exists' => ':attribute انتخابشده معتبر نیست.',
|
|
'string' => ':attribute باید متن باشد.',
|
|
'nullable' => '',
|
|
];
|
|
}
|
|
|
|
public static function attributes(): array
|
|
{
|
|
return [
|
|
'customer_id' => 'مشتری',
|
|
'product_id' => 'محصول',
|
|
'direction' => 'جهت معامله',
|
|
'price_condition' => 'شرط اجرا',
|
|
'trigger_price' => 'مظنه هدف',
|
|
'amount' => 'مقدار',
|
|
'number' => 'تعداد',
|
|
'expires_at' => 'زمان اعتبار',
|
|
'description' => 'توضیحات',
|
|
'is_active' => 'وضعیت فعال',
|
|
];
|
|
}
|
|
}
|