v2board/app/Http/Requests/Admin/MailSend.php

35 lines
803 B
PHP
Raw Normal View History

2019-12-30 22:40:39 +08:00
<?php
namespace App\Http\Requests\Admin;
use Illuminate\Foundation\Http\FormRequest;
class MailSend extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
2020-02-15 17:24:00 +08:00
'type' => 'required|in:1,2,3,4',
2019-12-30 22:40:39 +08:00
'subject' => 'required',
'content' => 'required',
'receiver' => 'array'
];
}
2020-01-11 13:36:52 +08:00
2019-12-30 22:40:39 +08:00
public function messages()
{
return [
'type.required' => '发送类型不能为空',
'type.in' => '发送类型格式有误',
'subject.required' => '主题不能为空',
'content.required' => '内容不能为空',
'receiver.array' => '收件人格式有误'
];
}
}