Closed batFormat closed 5 years ago
How define ValueCollection?
+1
I created an attribute that I try to add multiple values to, and I can not. I don't understand.
Do I need to add some method to the model?
+1
Please close.
The error was due to the fact that in the database I did not specify the attribute is_collection
, with value 1
.
I have created attribute "conditions", and attach values.
$advert = \App\Models\Advert::find(400); $advert->conditions->add(['value1', 'value2']);
Call to a member function add() on null