Closed zanozik closed 4 years ago
Just ran into this issue, trying to create a model like so:
$product = $shop->products()->create($request->input());
Where Product
uses HasFillableRelations
, and Shop
has a HasMany
relationship on products, results in the error:
General error: 1364 Field 'shop_id' doesn't have a default value (SQL: insert into `products`....
It just creates and saves the model without taking into account the parent relationship. Unfortunately I think I will have to stop using the package because of this.
The package is deceitful!
If you will make a new model and fill relationships, the package will automatically persist all of that in your database!!!