mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 17:49:11 +08:00
33 lines
721 B
PHP
33 lines
721 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Requests;
|
||
|
|
||
|
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' => '工单主题不能为空',
|
||
|
'level.required' => '工单级别不能为空',
|
||
|
'level.in' => '工单级别格式不正确',
|
||
|
'message.required' => '消息不能为空'
|
||
|
];
|
||
|
}
|
||
|
}
|