Closed robman70 closed 1 year ago
Hi @robman70,
//THIRD case: It does not work (no errors... it just doesn't do anything)
Please log the executed query.
Oh, damn! I use the Query Log all the time to look for errors, this time (I don't know why), I didn't. In fact, an SQL error did not occur but the query sequence was wrong and a constraint I had imposed on the relations prevented the update. Thanks so much for the help!
Hello, I'm using this library and the relations I've created are all working, great job!
Now I'm trying to do something that I can't do: I'm trying to modify (with the ->update()) method a set of records that I get from a hasManyDeep() relation but it doesn't work... it's possible to do it and I'm doing something wrong or is it not possible?
Example (within a Model):
The FIRST case is a direct update on the object itself ($this) and it works without problems.
The SECOND case is an update on a set of records returned from a 'normal' relationship, i.e.:
public function ordersRows() { return $this->hasMany('App\Models\OrdersRow')->where('orders_rows.deleted', 0); }
The THIRD case is an update on a set of records returned by a 'hasManyDeep' relationship (ordersPackages), i.e.:
The relationships work perfectly, it's just the UPDATE that fails... I don't know if I did something wrong.