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

<?php
namespace App\Http\Requests;
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Foundation\Http\FormRequest;
use Yo;
class EditAppointmentTemplateInput 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'],
'weeks' => ['required', 'between:1,50'],
'start_time' => ['required'],
'end_time' => ['required'],
'stop_time' => ['required'],
];
}
public function messages()
{
return [
'name.required' => 200013,
'name.between' => 200014,
'weeks.required' => 200015,
'weeks.between' => 200016,
'start_time.required' => 200017,
'end_time.required' => 200018,
'stop_time.required' => 200019,
];
}
public function failedValidation(Validator $validator)
{
Yo::error_echo($validator->errors()->first());
}
}