ActivityChangeStatusRequest.php 945 Bytes
<?php

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

use Hikoon\LaravelApi\Support\ApiRequest;

class ActivityChangeStatusRequest extends ApiRequest
{
    public function rules(): array
    {
        return [
            'status' => 'required|in:up,down,send,reUp',
            'msg'    => 'required_if:status,down|string|max:100',
            'link'   => 'required_if:status,send|url|max:400'

        ];
    }

    public function messages(): array
    {
        return [
            'status.required'  => '请选择状态值',
            'status.in'        => '状态值不在指定范围内',
            'msg.required_if'  => '请输入下架理由',
            'msg.max'          => '下架理由长度超出限制',
            'link.required_if' => '请输入发行链接',
            'link.url'         => '链接格式不正确',
            'link.max'         => '发行链接长度超出限制'
        ];
    }
}