fix(pivot): only use unique classes in the pivot union (Fixes #1606) (#1607)

* fix(pivot): only use unique classes in the pivot union (Fixes #1606)

* composer fix-style

---------

Co-authored-by: laravel-ide-helper <[email protected]>
This commit is contained in:
Pieter Willekens
2024-10-29 15:00:16 +01:00
committed by GitHub
co-authored by laravel-ide-helper
parent 7c2fa01d36
commit 07e3bd8796
3 changed files with 26 additions and 6 deletions
@@ -33,6 +33,12 @@ class ModelWithPivot extends Model
->using(CustomPivot::class);
}
public function relationCustomPivotUsingSameAccessorAndClass()
{
return $this->belongsToMany(ModelwithPivot::class)
->using(CustomPivot::class);
}
public function relationWithDifferentCustomPivotUsingSameAccessor()
{
return $this->belongsToMany(ModelwithPivot::class)