Laravel 5: when persist form data, _token causes mass assignment exception
or
protected $guarded = array();
A mass assignment exception is usually caused because you didn't specify the fillable
(or guarded
the opposite) attributes in your model. Do this:
class Order extends Eloquent {
protected $fillable = ['field1', 'foo', 'bar'];
}
This way you also don't have to worry about _token
because only the specified fields will be filled and saved in the db no matter what other stuff you pass to the model.