I've defined a virtual attribute:
class ContactForm extends Model {
public $name; // is not a DB field
I've noticed that it is not populated during massive assignment (after submitting the form, in $model->load($_POST)
). Can it be somehow populated along with DB attributes? Or am I doing something wrong that is not populated however it should be? Thanks!
Docs: Massive Assignments
Docs: Safe Attributes
You have to do some sort of validation on your attribute, if you don't have any validation needs - define it as
safe
.