File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
src/Illuminate/Database/Eloquent/Relations Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 6
6
use Illuminate \Database \Eloquent \Model ;
7
7
use Illuminate \Database \Eloquent \Builder ;
8
8
use Illuminate \Database \Eloquent \Collection ;
9
+ use Illuminate \Database \Eloquent \Relations \Pivot ;
9
10
use Illuminate \Database \Eloquent \ModelNotFoundException ;
10
11
11
12
class BelongsToMany extends Relation
@@ -266,6 +267,16 @@ protected function buildDictionary(Collection $results)
266
267
return $ dictionary ;
267
268
}
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
+
269
280
/**
270
281
* Specify the custom pivot model to use for the relationship.
271
282
*
You can’t perform that action at this time.
0 commit comments