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.2] Add a validator helper as a shorthand for Validate::make() #11146

Merged
merged 1 commit into from Dec 7, 2015

Conversation

AdenFraser
Copy link
Contributor

No description provided.

@GrahamCampbell GrahamCampbell changed the title Add a validate() helper as a shorthand for Validate::make() [5.2] Add a validate() helper as a shorthand for Validate::make() Dec 2, 2015
@GrahamCampbell
Copy link
Member

👎 for adding more helpers.

@JosephSilber
Copy link
Member

@GrahamCampbell I love me some helpers 🎱

*/
function validate(array $data, array $rules, array $messages = [], array $customAttributes = [])
{
$factory = app('Illuminate\Contracts\Validation\Factory');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please import this and use ::class notation.

@AdenFraser
Copy link
Contributor Author

Will do!

@GrahamCampbell
Copy link
Member

Also, please rebase to avoid conflicts when importing since I recently modified this file.

@AdenFraser
Copy link
Contributor Author

Squashed the amend in and rebased to the HEAD of 5.2, I assume that's correct?

@taylorotwell
Copy link
Member

Seems like it should be named validator?

@AdenFraser
Copy link
Contributor Author

That would make more sense actually, given the other factory helpers are defined in the same way.

@AdenFraser AdenFraser force-pushed the patch-1 branch 2 times, most recently from 21bd68a to 803d1e6 Compare December 3, 2015 15:39
@GrahamCampbell GrahamCampbell changed the title [5.2] Add a validate() helper as a shorthand for Validate::make() [5.2] Add a validator helper as a shorthand for Validate::make() Dec 3, 2015
@taylorotwell
Copy link
Member

Helper functions are kept in alphabetical order.

@GrahamCampbell
Copy link
Member

Helper functions are kept in alphabetical order.

Ha. We probably need a StyleCI check for that, lol. The whole if statement stuff makes that sort of check slightly harder to implement, which is a shame.

@AdenFraser
Copy link
Contributor Author

Sorting that now :)

@AdenFraser AdenFraser force-pushed the patch-1 branch 2 times, most recently from bf53ece to 2b05401 Compare December 4, 2015 23:46
@AdenFraser
Copy link
Contributor Author

Hopefully thats all good! 😀

and use ::class notation. Order new helper alphabetically :)
taylorotwell added a commit that referenced this pull request Dec 7, 2015
[5.2] Add a validator helper as a shorthand for Validate::make()
@taylorotwell taylorotwell merged commit 78ff3d1 into laravel:5.2 Dec 7, 2015
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.

None yet

5 participants