MusicianWithdrawRequest.php 911 Bytes
<?php

namespace App\Http\Requests\Admin;

use Illuminate\Foundation\Http\FormRequest;

class MusicianWithdrawRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'order_id' => ['required', 'bail'],
            'status'   => ['required', 'bail', 'in:1,2']
        ];
    }

    /**
     * 获取已定义验证规则的错误消息
     */
    public function messages(): array
    {
        return [
            'order_id.required' =>  '订单号不存在',
            'status.required'   =>  '审核状态错误',
            'status.in'         =>  '审核状态错误',
        ];
    }
}