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

validate multiple fields #49

Closed
matthijs-neijenhuijs opened this issue Dec 27, 2015 · 1 comment
Closed

validate multiple fields #49

matthijs-neijenhuijs opened this issue Dec 27, 2015 · 1 comment

Comments

@matthijs-neijenhuijs
Copy link

I want to validate multiple fields, i can do this with this:

$rules['en.title'] = 'required|between:4,65|unique_with:product_translation, en.title = title, '.$id.' = product_id';

But i want to set combination field and the custom name, how does this work? I have the field "locale" thats the combination field and i have als title in place of en.title.

@felixkiss
Copy link
Owner

Just add it to the rule.

$rules['en.title'] = 'required|between:4,65|unique_with:product_translation, locale, en.title = title, '.$id.' = product_id';

This will ensure that the combination of en.title and locale is not yet in the database (but ignores all database rows with a product_id of $id.

Does this solve it?

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

2 participants