save accepts Input::all() fixes "sometimes" validator#166
save accepts Input::all() fixes "sometimes" validator#166tbergeron wants to merge 3 commits intolaravel-ardent:masterfrom
Conversation
->save($data, $rules, $customMessages, $beforeSave, $afterSave); that way the "sometimes" validator will work.
|
Sorry, I didn't understand the point on this PR. I haven't used Ardent for quite some time, but in my understanding, an AR model should always validate it's internal fields, unrelated to form data. If you want to validate what's on the form you pull it inside the model first, isn't it? Furthermore, I think that although it makes sense to use the said |
|
I'm having some trouble related with "sometimes". I'm trying to update a user, but without change the |
That validator only validates the field when it is specified in the form's data (when it's in the attributes). Ardent used the model's attributes instead of using the actual data coming from the form.
i.e. Saving a user without checking if his username is unique on every save, would simply never work.
Now we can do:
savemethod now looks like this:Hope this helps somebody ;-)