Get rules of password hash.
@return array password hash rules.
359852
public function getPasswordHashRules()
    {
        if (!is_string($this->passwordHashAttribute) || empty($this->passwordHashAttribute)) {
            return [];
        }
        if (empty($this->passwordHashRules) || !is_array($this->passwordHashRules)) {
            $this->passwordHashRules = [
                [[$this->passwordHashAttribute], 'string', 'max' => $this->passwordHashAttributeLength],
            ];
        }
        return $this->passwordHashRules;
    }
1215806
public function rules(): array
    {
        $user = $this->route('ability') ?? new Ability();
        $user->updateRulesUniques();
        $rules = $user->getRules();
        $rules['roles'] = 'nullable|array';

        return $rules;
    }
1031992
public function rules()
    {
        $hash = $this->input('hash');
        $id = (! empty($hash)) ? $this->post->byHash($hash)->id : 0;
        $protected_visibility = $this->visibility->whereName('Protected')->first()->hash;

        return [
            'title'             => 'required|min:2|max:100',
            'slug'              => "required|unique:posts,slug,$id|min:2|max:120",
            'reviewer'          => 'exists:users,hash',
            'post'              => 'required',
            'category'          => 'required|exists:categories,hash',
            'publishdate'       => 'required|date_format: d-m-Y H:i',
            'password'          => "required_if:visibility,$protected_visibility",
        ];
    }
1255122
public function getRules()
    {
        $rules = [
            static::FIRST_NAME => "required|max:100",
            static::LAST_NAME => "required|max:100",
            static::EMAIL => "required|max:100|email|unique:users,email,{$this->id},id",
        ];
        if (!$this->id) {
            $rules[static::PWD_FIELD] = 'required|min:' . config('app.model.user.password.min', 6)
                . '|max:' . config('app.model.user.password.max', 20);
        }
        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;
    }
539018
public function getRule()
    {
        $rules = [];
        if ($this->isRequired()) {
            $rules[] = 'required';
        }
        if ($this->getValidations()) {
            $rules[] = $this->getValidations();
        }

        $rules = join('|', $rules);
        return $rules;
    }
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();
    }
62817
public function getRules()
    {
        $action = $this->getActionReplaced();
        if (method_exists($this->formRequest, $action)) {
            return call_user_func([$this->formRequest, $action]);
        }

        if (method_exists($this->formRequest, 'rules')) {
            return call_user_func([$this->formRequest, 'rules']);
        }

        return [];
    }
420685
public function getPasswordHasher() {
		if ($this->_passwordHasher) {
			return $this->_passwordHasher;
		}

		return $this->_passwordHasher = PasswordHasherFactory::build($this->_defaultPasswordHasher);
	}
73691
public function rules(): array
    {
        $member = $this->route('member') ?? app('cortex.auth.member');
        $member->updateRulesUniques();
        $rules = $member->getRules();

        $rules['roles'] = 'nullable|array';
        $rules['abilities'] = 'nullable|array';
        $rules['password'] = $member->exists
            ? 'confirmed|min:'.config('cortex.auth.password_min_chars')
            : 'required|confirmed|min:'.config('cortex.auth.password_min_chars');

        return $rules;
    }
1129022
public function rules()
    {
        return [
            'name' => [
                'required',
                'string',
                'between:3,255',
                'regex:/^[\w\s\.\,\-\_]+$/u',
            ],
            'email' => [
                'required',
                'email',
                'between:6,255',
                'unique:users,email' . (isset($this->user->id) ? ','.$this->user->id.',id' : ''),
            ],
            'password' => [
                'string',
                'between:6,255',
                'confirmed',
                isset($this->user->id) ? 'nullable' : 'required',
            ],
            'role' => [
                'sometimes',
                'required',
                'string',
                'max:255',
                'in:' . implode(',', cache('roles')),
            ],
            'where_from' => [
                'nullable',
                'string',
                'max:255',
                'alpha_num',
            ],
            'info' => [
                'nullable',
                'string',
                'max:500',
                'regex:/^[\w\s\.\,\-\_\?\!\r\n]+$/u',
            ],
            'avatar' => [
                'nullable',
                'image',
                'mimes:png,jpg,jpeg,gif,bmp',
                'max:800',
                'dimensions:max_width='.setting('users.avatar_max_width', 140).',max_height='.setting('users.avatar_max_height', 140),
            ],
        ];
    }
959892
function rules() {
        $rules = $this->rules;
        array_walk($rules, function (&$v) {
            $v = implode('|', $v);
        });

        return $rules;
    }
413580
protected function getBoundRules()
    {
        if ($this->bypass === true) {
            return [];
        }

        $rules = $this->getRules();

        foreach ($rules as $key => $value) {
            if ($binding = array_get($this->bindings, $key)) {
                $rules[$key] = str_replace('{'.$key.'}', $binding, $value);
            }
        }

        return $rules;
    }
1147432
public function rules(): array
    {
        $user = $this->user($this->route('guard'));

        // Attach attribute rules
        $user->getEntityAttributes()->each(function ($attribute, $attributeName) use (&$rules) {
            switch ($attribute->type) {
                case 'datetime':
                    $type = 'date';
                    break;
                case 'text':
                case 'check':
                case 'select':
                case 'varchar':
                    $type = 'string';
                    break;
                default:
                    $type = $attribute->type;
                    break;
            }

            $rule = ($attribute->is_required ? 'required|' : 'nullable|').$type;
            $rules[$attributeName.($attribute->is_collection ? '.*' : '')] = $rule;
        });

        return $rules ?? [];
    }
631445
public function rules()
    {

        $name = $this->route()->getName();
        $tbl = ( str_contains($name, 'role') ) ? 'roles' : 'permissions';

       return [
            'name' => 'required|unique:'.$tbl.'|max:255|min:4',
            'slug' => 'required|unique:'.$tbl.'|max:255|min:4',
        ];

    }
709976
public function rules()
    {
        $rules = $this->filterRules(array_merge([
            [['username', 'password'], 'trim'],
            [['username', 'password'], 'required'],
            ['rememberMe', 'boolean'],
            ['password', 'authenticate'],
        ], $this->rulesAddScenario(parent::rules(), 'reset')));

        return $rules;
    }
938146
public function getValidationRules()
    {
        $rules = [];

        foreach ($this->rules as $name => $rule) {
            $ruleName         = sprintf('2fa.*.settings.%s', $name);
            $rules[$ruleName] = $rule;
        }

        return $rules;
    }