1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- declare(strict_types=1);
- namespace App\Request\Api\v1\Live;
- use Hyperf\Validation\Request\FormRequest;
- class FollowRequest 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 [
- 'room_no' => 'required|string',
- 'status' => 'required|integer:strict',
- ];
- }
- /**
- * 获取已定义验证规则的错误消息
- */
- public function messages(): array
- {
- return [
- 'room_no.required' => '请填写直播间编号',
- ];
- }
- /**
- * 验证的各字段的含义
- * @return array|string[]
- */
- public function attributes(): array
- {
- return [
- 'room_no' => '直播间编号',
- ];
- }
- }
|