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

Can't retrieve invalid data from Validator #14646

Closed
carloscarucce opened this issue Aug 5, 2016 · 7 comments
Closed

Can't retrieve invalid data from Validator #14646

carloscarucce opened this issue Aug 5, 2016 · 7 comments

Comments

@carloscarucce
Copy link
Contributor

I am trying to get data that didn't pass on validation with Validator->invalid()

Here is my test:

$data = [
    ['name' => 'John', 'age' => 30],
    ['name' => 'Robert', 'age' => 'nope'],
    ['name' => ['woops']]
];

$validator = \Validator::make($data, [
    '*.name' => 'required|string|max:200',
    '*.age' => 'required|int'
]);

dd($validator->invalid());

Expected:

[
    ['name' => 'Robert', 'age' => 'nope'],
    ['name' => ['woops']]
]

But instead, I am getting an empty array. Is there something I'm doing wrong?

@themsaid
Copy link
Member

themsaid commented Aug 5, 2016

@xxnoobmanxx I believe you need to submit the PR to this repository not illuminate/validation as it's a READ ONLY repo.

@carloscarucce
Copy link
Contributor Author

Thanks. Didn't notice it.

@themsaid
Copy link
Member

themsaid commented Aug 7, 2016

I think the PR is still submitted to illuminate/validation not here.

@themsaid
Copy link
Member

themsaid commented Aug 7, 2016

Oh, got it :) didn't see this one #14651

@GrahamCampbell
Copy link
Member

Thanks for reporting. :)

@carloscarucce
Copy link
Contributor Author

Hi. I just updated my project to the version released today (5.2.43), and these methods are still buggy. Can you please reopen this issue, or take a look at my patch, please? @GrahamCampbell

@themsaid
Copy link
Member

@xxnoobmanxx the PR is not merged yet. If merged you'll be able to have the fix in the release that comes after.

symfony-splitter pushed a commit to illuminate/validation that referenced this issue Aug 12, 2016
invalid() and valid() methods where returning empty arrays
Issue link: laravel/framework#14646
tillkruss pushed a commit to tillkruss/framework that referenced this issue Aug 30, 2016
invalid() and valid() methods where returning empty arrays
Issue link: laravel#14646
taylorotwell pushed a commit to illuminate/validation that referenced this issue Sep 17, 2018
invalid() and valid() methods where returning empty arrays
Issue link: laravel/framework#14646
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants