This is an for internal app, mass assignment security is not an issue in this case.
I'm dealing with very large (numerous) form fields, so mass assigning the user edits would be great. Mass assignment seems to work fine with 'create()' but not with doing a find & save.
This is what I have:
$post_data = Input::all(); $formobj = HugeForm::find($id); $formobj->save($post_data);
How do I go about it? I'd rather not specify many dozens of form inputs.
You should be able to use fill(array $attributes)
...
$post_data = Input::all(); $formobj = HugeForm::find($id); $formobj->fill($post_data); $formobj->save();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With