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

33 lines
755 B
PHP
Raw Normal View History

2019-12-12 19:47:32 +08:00
<?php
2020-01-29 16:22:39 +08:00
namespace App\Http\Requests\User;
2019-12-12 19:47:32 +08:00
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'
];
}
2020-01-11 13:36:52 +08:00
2019-12-12 19:47:32 +08:00
public function messages()
{
return [
2021-06-12 00:56:39 +08:00
'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')
2019-12-12 19:47:32 +08:00
];
}
}