<?php

namespace App\Http\Requests\Process;

use App\Http\Requests\Request;

class RenewFormRequest extends Request
{
    /**
     * 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()
    {

        if (!$this->ajax()) {
            return [];
        }
        return [
            'contract_deadline' => 'required',
            'contract_amount' => 'required',
            'keyword_goal' => 'required|numeric',
            'article_goal' => 'required|numeric',
            'link_goal' => 'required|numeric',
            'other_demand' => 'nullable',
        ];
    }

    public function attributes()
    {
        return [
            'contract_deadline' => '合同期限',
            'contract_amount' => '合同金额',
            'keyword_goal' => '关键词达标数',
            'link_goal' => '外链平台数',
            'article_goal' => '软文达标数',
            'other_demand' => '其他需求',
        ];
    }
}