Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getValidatedData returns unknown keys #93

Open
naquad opened this issue May 1, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@naquad
Copy link

commented May 1, 2019

Hi

I have this rule set:

        'id'                      => 'required|integer|unique:accounts,id|min:1',
        'company'                 => 'required|max:255',

        'domains'                 => 'required|array',
        'domains.*.domain'        => 'required|regex:/\A[\w:.-]+\z/|unique:domains,domain',
        'domains.*.sslify'        => 'bool|default:1',
        'domains.*.redirect'      => 'bool|default:0',
        'domains.*.redirect_code' => 'in:301,302|default:301',
        'domains.*.origin'        => 'required|url',

And this query:

{
  "id": 1,
  "company": "asd",
  "domains": [
    {
      "domain": "www.example.com",
      "ssl": "true",
      "origin": "https://www.google.com"
    }
  ]
}

Mind the "ssl" key. It was not described in rules.

Still, I get it from getValidatedData() call:

Array
(
    [id] => 1
    [company] => asd
    [domains] => Array
        (
            [0] => Array
                (
                    [domain] => www.example.com
                    [ssl] => true
                    [origin] => https://www.google.com
                    [sslify] => 1
                    [redirect] => 0
                    [redirect_code] => 301
                )

        )

)

Version is 1.1.1, PHP 7.3.3.

P. S. Same happens with getValidData().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.