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.3] Object based unique and exists rules for validation. #15809

Merged
merged 6 commits into from
Oct 7, 2016

Conversation

taylorotwell
Copy link
Member

Provides a more fluent and memorable interface for these rules when performing validation.

$validator = Validator::make(['name' => 'Taylor Otwell'], [
    'name' => [
        Rule::unique('users')->ignore(2)->where(function ($query) {
            $query->where('password', 'secret');
        }),

        Rule::exists('users', 'name')->where(function ($query) {
            $query->where('id', '>', 0);
        }),
    ],
]);

@GrahamCampbell GrahamCampbell changed the title Object based unique and exists rules for validation. [5.3] Object based unique and exists rules for validation. Oct 7, 2016
@taylorotwell taylorotwell merged commit cc1df99 into 5.3 Oct 7, 2016
@taylorotwell taylorotwell deleted the feature/object-rules branch October 7, 2016 18:56
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