Files
moonwell-web/app/Http/Requests/CreateInviteCodesRequest.php
T

37 lines
1.0 KiB
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class CreateInviteCodesRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
/**
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'quantity' => ['required', 'integer', 'min:1', 'max:50'],
];
}
/**
* @return array<string, string>
*/
public function messages(): array
{
return [
'quantity.required' => __('Укажи количество инвайт-кодов.'),
'quantity.integer' => __('Количество должно быть числом.'),
'quantity.min' => __('Нужно создать минимум один инвайт-код.'),
'quantity.max' => __('За один раз можно создать не больше 50 инвайт-кодов.'),
];
}
}