Setting the model two times one on key '0' and again on key 'model' passes that model two times in the Clojure which makes the parameter names invalid.
static::pivotSynced(function ($model, $relationName, $changes) {
// $model is indeed model, key '0'
// $relationName is **again** model, key 'model'
// $changes is relation name, key 'relation'
// etc
});
This occurs on other event methods as well, pivotAttaching, pivotDetached, etc.
Great package, thank you for your work.
https://github.com/GeneaLabs/laravel-pivot-events/blob/3e076a8d266baf0833e7496ca4e5eb65d5df4b76/src/Traits/ExtendFireModelEventTrait.php#L39-L45
Setting the model two times one on key '0' and again on key 'model' passes that model two times in the Clojure which makes the parameter names invalid.
This occurs on other event methods as well,
pivotAttaching
,pivotDetached
, etc.Please fix that.