There was an error while loading. Please reload this page.
1 parent 4777740 commit 641d087Copy full SHA for 641d087
1 file changed
src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
@@ -6,6 +6,7 @@
6
use Illuminate\Database\Eloquent\Model;
7
use Illuminate\Database\Eloquent\Builder;
8
use Illuminate\Database\Eloquent\Collection;
9
+use Illuminate\Database\Eloquent\Relations\Pivot;
10
use Illuminate\Database\Eloquent\ModelNotFoundException;
11
12
class BelongsToMany extends Relation
@@ -266,6 +267,16 @@ protected function buildDictionary(Collection $results)
266
267
return $dictionary;
268
}
269
270
+ /**
271
+ * Get the class being used for pivot models.
272
+ *
273
+ * @return string
274
+ */
275
+ public function getPivotClass()
276
+ {
277
+ return $this->using ?? Pivot::class;
278
+ }
279
+
280
/**
281
* Specify the custom pivot model to use for the relationship.
282
*
0 commit comments