You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
859 B
PHP
48 lines
859 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Contracts\Validation\Validator;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Yo;
|
|
|
|
class EditHospitalQuestionInput extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function authorize()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
'question' => ['required', 'between:1,200'],
|
|
'mark' => ['between:0,20'],
|
|
];
|
|
}
|
|
|
|
public function messages()
|
|
{
|
|
return [
|
|
'question.required' => 200067,
|
|
'question.between' => 200068,
|
|
'mark.between' => 100026,
|
|
];
|
|
}
|
|
|
|
public function failedValidation(Validator $validator)
|
|
{
|
|
Yo::error_echo($validator->errors()->first());
|
|
}
|
|
}
|