belongsToMany(ModelwithPivot::class) ->using(CustomPivot::class) ->as('customAccessor'); } public function relationWithDifferentCustomPivot() { return $this->belongsToMany(ModelwithPivot::class) ->using(DifferentCustomPivot::class) ->as('differentCustomAccessor'); } // without an accessor public function relationCustomPivotUsingSameAccessor() { return $this->belongsToMany(ModelwithPivot::class) ->using(CustomPivot::class); } public function relationCustomPivotUsingSameAccessorAndClass() { return $this->belongsToMany(ModelwithPivot::class) ->using(CustomPivot::class); } public function relationWithDifferentCustomPivotUsingSameAccessor() { return $this->belongsToMany(ModelwithPivot::class) ->using(DifferentCustomPivot::class); } }