123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- declare(strict_types=1);
- namespace App\Request\Api\v1\Live;
- use Hyperf\Validation\Request\FormRequest;
- class RoomAddRequest extends FormRequest
- {
- /**
- * Determine if the user is authorized to make this request.
- */
- public function authorize(): bool
- {
- return true;
- }
- /**
- * Get the validation rules that apply to the request.
- */
- public function rules(): array
- {
- return [
- 'name' => 'required|string',
- 'image' => 'nullable|string',
- ];
- }
- /**
- * 获取已定义验证规则的错误消息
- */
- public function messages(): array
- {
- return [
- 'name.required' => '请填写直播间名称',
- ];
- }
- /**
- * 验证的各字段的含义
- * @return array|string[]
- */
- public function attributes(): array
- {
- return [
- 'name' => '直播间名称',
- 'image' => '直播间封面图',
- ];
- }
- }
|