33 lines
759 B
PHP
33 lines
759 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests\Api\Order;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class RenewServiceRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'months' => ['required', 'integer', 'min:1', 'max:36'],
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'months.required' => 'Vui lòng chọn số tháng gia hạn.',
|
|
'months.integer' => 'Số tháng gia hạn không hợp lệ.',
|
|
'months.min' => 'Số tháng gia hạn tối thiểu là 1.',
|
|
'months.max' => 'Số tháng gia hạn tối đa là 36.',
|
|
];
|
|
}
|
|
}
|