CertifyUpdateRequest.php 676 Bytes
<?php

namespace App\Http\Container\AdminSection\Requests\User;

use Hikoon\LaravelApi\Support\ApiRequest;

class CertifyUpdateRequest extends ApiRequest
{
    /**
     * @return string[]
     */
    public function rules(): array
    {
        return [
            'status' => 'required|in:1,2',
            'reason' => 'required_if:status,2'
        ];
    }

    /**
     * @return string[]
     */
    public function messages(): array
    {
        return [
            'status'             => '请选择审核结果',
            'status.in'          => '审核结果不在指定范围内',
            'reason.required_if' => '请输入审核理由'
        ];
    }
}