check(); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'video_id' => [ 'required', 'string', function (string $attribute, mixed $value, \Closure $fail) { if (!IsValidYoutubeId::validates($value) and !IsValidVimeoId::validates($value)) { (new IsValidYoutubeId())->validate($attribute, $value, $fail); (new IsValidVimeoId())->validate($attribute, $value, $fail); } } ], ]; } /** * Get custom attributes for validator errors. * * @return array */ public function attributes(): array { return [ 'video_id' => trans('validation.custom.video_id'), ]; } }