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.
55 lines
1.1 KiB
PHP
55 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Contracts\Validation\Validator;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Yo;
|
|
|
|
class EditUserPersonInput 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 [
|
|
'name' => ['required', 'between:1,50'],
|
|
'id_number' => ['required', 'between:1,50'],
|
|
'phone' => ['required', 'between:1,30'],
|
|
'relationship' => ['required', 'between:1,30'],
|
|
];
|
|
}
|
|
|
|
public function messages()
|
|
{
|
|
return [
|
|
'name.required' => 200034,
|
|
'name.between' => 200035,
|
|
'id_number.required' => 200036,
|
|
'id_number.between' => 200037,
|
|
'phone.required' => 200038,
|
|
'phone.between' => 200039,
|
|
'relationship.required' => 200040,
|
|
'relationship.between' => 200041,
|
|
];
|
|
}
|
|
|
|
public function failedValidation(Validator $validator)
|
|
{
|
|
Yo::error_echo($validator->errors()->first());
|
|
}
|
|
}
|