v2board/app/Http/Requests/User/TicketSave.php
2021-06-12 01:56:39 +09:00

33 lines
755 B
PHP

<?php
namespace App\Http\Requests\User;
use Illuminate\Foundation\Http\FormRequest;
class TicketSave extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'subject' => 'required',
'level' => 'required|in:0,1,2',
'message' => 'required'
];
}
public function messages()
{
return [
'subject.required' => __('Ticket subject cannot be empty'),
'level.required' => __('Ticket level cannot be empty'),
'level.in' => __('Incorrect ticket level format'),
'message.required' => __('Message cannot be empty')
];
}
}