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

Update validators #10

Open
elstamey opened this issue Jul 15, 2014 · 2 comments
Open

Update validators #10

elstamey opened this issue Jul 15, 2014 · 2 comments

Comments

@elstamey
Copy link

In the laracasts demonstration, there was never any situation that used the validators to update, and I could really use some help with validating uniqueness except on update. Could you provide an example in the README or add a Laracast link to something that will help me fix the mess I've created?

@arthurkirkosa
Copy link

The update form should be it's own class with it's own set of rules.

if you need to pass the id to check for uniqueness, in your update form class overwrite the

public function getValidationRules();

or add another function that will prepare the $rules (by replacing a string in your rules with the actual id value) and return $this and chain that to the form before calling the validate() method.

@schulzefelix
Copy link

You should look at #6

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