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

[5.6] Validator should return validated data #23397

Merged
merged 1 commit into from
Mar 6, 2018
Merged

[5.6] Validator should return validated data #23397

merged 1 commit into from
Mar 6, 2018

Conversation

adam1010
Copy link
Contributor

@adam1010 adam1010 commented Mar 5, 2018

Currently in your controller if you're using:
$data = $request->validate([...]);

If you need to switch to using advanced rules, there is no direct method available for accessing the validated data:

$validator = Validator::make($request->all(), [...]);
$validator->sometimes('phone', 'required', function(){ ... });
$data = $validator->validate();  // This PR adds this return value

@adam1010 adam1010 changed the title Validator should return validated data [5.6] Validator should return validated data Mar 5, 2018
@taylorotwell taylorotwell merged commit 557177c into laravel:5.6 Mar 6, 2018
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

Successfully merging this pull request may close these issues.

2 participants