Validation rules associated with other guid attribute.
@return array rules.
355859
public function getOtherGuidRules()
    {
        $rules = array_merge($this->getMutualRules(), [
            [[$this->otherGuidAttribute,
                $this->createdByAttribute],
                'unique',
                'targetAttribute' => [$this->otherGuidAttribute, $this->createdByAttribute]],
        ]);
        return $rules;
    }
620714
public function rules(): array
    {
        $event = $this->route('event') ?? app('cortex.bookings.event');
        $event->updateRulesUniques();

        return array_merge($event->getRules(), [
            'duration' => 'required',
        ]);
    }
1304939
public function rules(): array
    {
        $service = $this->route('service') ?? app('cortex.bookings.service');
        $service->updateRulesUniques();
        $rules = $service->getRules();

        $rules['availabilities.*.range'] = ['sometimes', 'required', 'string'];
        $rules['availabilities.*.from'] = ['sometimes', 'required', 'string'];
        $rules['availabilities.*.to'] = ['sometimes', 'required', 'string'];
        $rules['availabilities.*.is_bookable'] = ['sometimes', 'boolean'];
        $rules['availabilities.*.priority'] = ['sometimes', 'nullable', 'integer'];

        $rules['rates.*.range'] = ['sometimes', 'required', 'string'];
        $rules['rates.*.from'] = ['sometimes', 'required', 'string'];
        $rules['rates.*.to'] = ['sometimes', 'required', 'string'];
        $rules['rates.*.base_cost'] = ['sometimes', 'nullable', 'numeric'];
        $rules['rates.*.unit_cost'] = ['sometimes', 'required', 'numeric'];

        return $rules;
    }
688670
public function getDescriptionRules()
    {
        $rules = [];
        if (is_string($this->descriptionAttribute) && !empty($this->descriptionAttribute)) {
            $rules[] = [
                [$this->descriptionAttribute],
                'string'
            ];
            $rules[] = [
                [$this->descriptionAttribute],
                'default',
                'value' => $this->initDescription,
            ];
        }
        return $rules;
    }
890558
public function rules() {

		$rules = [
			[ [ 'widgetId', 'htmlOptions', 'icon', 'order' ], 'safe' ],
			[ 'widget', 'boolean' ],
			[ 'order', 'number', 'integerOnly' => true ]
		];

		if( Yii::$app->core->trimFieldValue ) {

			$trim[] = [ [ 'htmlOptions', 'icon' ], 'filter', 'filter' => 'trim', 'skipOnArray' => true ];

			return ArrayHelper::merge( $trim, $rules );
		}

		return $rules;
	}
315442
public function getModelStaticValidationRules()
    {
        $model = $this->getDataModel();

        return isset($model::$rules) && is_array($model::$rules) ? $model::$rules : false;
    }
773998
public function rules() {

		$rules = [
			// Required, Safe
			[ [ 'firstName', 'lastName', 'email' ], 'required' ],
			[ 'phone', 'required', 'on' => [ 'phone', 'phone-captcha' ] ],
			// Text Limit
			[ [ 'email', 'phone' ], 'string', 'min' => 1, 'max' => Yii::$app->core->xLargeText ],
			// Other
			[ 'email', 'email' ]
		];

		if( empty( $this->captchaAction ) ) {

			$this->captchaAction	= '/cart/cart/captcha';
		}

		$rules[] = [ 'captcha', 'captcha', 'captchaAction' => $this->captchaAction, 'on' => [ 'captcha', 'phone-captcha' ] ];

		if( Yii::$app->core->trimFieldValue ) {

			$trim[] = [ [ 'firstName', 'lastName', 'email', 'phone' ], 'filter', 'filter' => 'trim', 'skipOnArray' => true ];

			return ArrayHelper::merge( $trim, $rules );
		}

		return $rules;
	}
47175
public function getAuthKeyRules()
    {
        if (!is_string($this->authKeyAttribute) || empty($this->authKeyAttribute)) {
            return [];
        }
        if (empty($this->authKeyRules)) {
            $this->authKeyRules = [
                [[$this->authKeyAttribute], 'required'],
                [[$this->authKeyAttribute], 'string', 'max' => 40],
            ];
        }
        return $this->authKeyRules;
    }
1304878
public function getRules(): array
    {
        if (count($this->large) === 0) {
            $this->large = $this->apriori();
        }

        if (count($this->rules) > 0) {
            return $this->rules;
        }

        $this->rules = [];

        $this->generateAllRules();

        return $this->rules;
    }
1321808
public function rules()
    {
        $crude = CrudeInstance::get($this->crudeName);

        if ($crude == null)
            return [];

        if (! $crude instanceof \JanDolata\CrudeCRUD\Engine\Interfaces\WithValidationInterface)
            return [];

        $attr = $crude->getCrudeSetup()->getEditForm();

        return $crude->getValidationRules($attr, $this->all());
    }
58228
public function getStatusRules()
    {
        if (!is_string($this->statusAttribute) || empty($this->statusAttribute)) {
            return [];
        }
        if (empty($this->statusRules)) {
            $this->statusRules = [
                [[$this->statusAttribute], 'required'],
                [[$this->statusAttribute], 'number', 'integerOnly' => true, 'min' => 0],
            ];
        }
        return $this->statusRules;
    }
9193
protected function getValidationRules(): array
    {
        return [
            QueryComplexity::class => new QueryComplexity(config('lighthouse.security.max_query_complexity', 0)),
            QueryDepth::class => new QueryDepth(config('lighthouse.security.max_query_depth', 0)),
            DisableIntrospection::class => new DisableIntrospection(config('lighthouse.security.disable_introspection', false)),
        ];
    }
1107601
public function getIPRules()
    {
        $rules = [];
        if ($this->enableIP & static::$ipv4) {
            $rules = [
                [[$this->ipAttribute],
                    'string', 'max' => 4
                ],
            ];
        }
        if ($this->enableIP & static::$ipv6) {
            $rules = [
                [[$this->ipAttribute],
                    'string', 'max' => 16
                ],
            ];
        }
        if ($this->enableIP & static::$ipAll) {
            $rules[] = [
                [$this->ipTypeAttribute], 'in', 'range' => [IP::IPv4, IP::IPv6],
            ];
        }
        return $rules;
    }
1255975
public function rules()
    {
        $attributes = [
            'title' => 'required',
            'text'  => 'required',
        ];

        $rules = $this->buildLocalizedRules($attributes);

        return array_merge($rules, [
            'id'           => 'exists:site_pages,id',
            'slug'         => 'required|alpha_dash|unique:site_pages,slug,'.$this->route('sites'),
            'published_at' => 'date',
            'concealed_at' => 'date',
        ]);
    }
1013908
public function rules()
	{
		$data = array();
		foreach ($this->validators as $validate)
		{
			$attrs = $this->klass->getStaticPropertyValue($validate);

			foreach (wrap_strings_in_arrays($attrs) as $attr)
			{
				$field = $attr[0];

				if (!isset($data[$field]) || !is_array($data[$field]))
					$data[$field] = array();

				$attr['validator'] = $validate;
				unset($attr[0]);
				array_push($data[$field],$attr);
			}
		}
		return $data;
	}
65412
public function rules(): array
    {
        $input = array_keys($this->request->all());

        return Parameter::whereIn('id', $input)
            ->get()
            ->mapWithKeys(function ($item) {
                return [$item['id'] => $item->rules];
            })->all();
    }
352110
public function rules()
    {
        $segment = $this->segment(3);
        $id = isset($segment) ? $this->category->byHash($this->segment(3))->id : 0;

        return [
            'name'		=> "required|unique:categories,name,$id|min:3|max:45",
        ];
    }