REBELinBLUE\Deployer\Http\Requests\StoreCommandRequest::rules PHP Метод

rules() публичный Метод

Get the validation rules that apply to the request.
public rules ( ) : array
Результат array
    public function rules()
    {
        $rules = ['name' => 'required|max:255', 'user' => 'max:255', 'script' => 'required', 'optional' => 'boolean', 'default_on' => 'boolean', 'step' => 'required|integer|min:' . Command::BEFORE_CLONE . '|max:' . Command::AFTER_PURGE, 'target_type' => 'required|in:project,template', 'target_id' => 'required|integer|exists:' . $this->get('target_type') . 's,id'];
        // On edit we don't require the step or the project_id
        if ($this->get('id')) {
            unset($rules['step']);
        }
        return $rules;
    }
StoreCommandRequest