php - Laravel 4 field validation issues on edit -


I'm using a simple default authentication on user creation, however, there is no user type editing functionality Not a problem, I can write that script. The problem I have is on the user's updates. I failed to verify for the following:

  • Email has already been taken.
  • The password should be between 4 and 11 characters.
  • The password does not match the confirmation.

While editing, the email is taken because it is the same email. I am not editing the password

Then my question: How can I turn verification off for editing, or better yet, how do I apply different verification rules for those methods?

You can do this by changing the default values, which were provided with the package Are there. They can be found on line 50:

  public fixed $ rule = array ('username' = & gt; 'required | alpha_adas | unique: user', 'email' = & gt; ; 'Required | Email: Unique: User', 'Password' = & gt; 'Required: Between: 411 Confirmation', 'password_confirmation' = & gt; 'Between: 4, 11',);  

In a Class ConfideUser.

Just replace those rules with ones you own. If you do not have any rules, then password_confirmation, then delete it.

I hope it will be helpful.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -