Xboard/app/Http/Requests/User/TicketSave.php

33 lines
755 B
PHP
Raw Normal View History

2023-11-17 01:44:01 -05:00
<?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')
];
}
}