Closed chrisvidal closed 7 months ago
Facing the same issue and i cant find any fix or a work around. did you manage to get something to work?
nope I didn't for this one...still no ids and no attributes vcalues
few hours ago i figured a way with PivotModel. On relationship definition in the Model, added extra prop PivotModel
=> MyClass::class. the MyClass extends Pivot from use October\Rain\Database\Pivot;
.
and inside of that custom class, in the boot
function i added
static::saving(function ($pivot) {
// logic ...
}
and in here $pivot
has all the data.
Its a shame you have to create a whole new class literally just for this but It works. atleast in my case.
This should be fixed in v3.6 which will be released soon.
in the model
user.php
, the__construct
is listening for new relation to be attached or detached.the issue is that the parameters
attributes
is always null and does not contains the pivot data as expected.the log outputs: