File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -303,11 +303,11 @@ public function belongsToMany(
303
303
// First, we'll need to determine the foreign key and "other key" for the
304
304
// relationship. Once we have determined the keys we'll make the query
305
305
// instances as well as the relationship instances we need for this.
306
- $ foreignPivotKey = $ foreignPivotKey ?: $ this ->getForeignKey () . ' s ' ;
306
+ $ foreignPivotKey = $ foreignPivotKey ?: Str:: plural ( $ this ->getForeignKey ()) ;
307
307
308
308
$ instance = new $ related ();
309
309
310
- $ relatedPivotKey = $ relatedPivotKey ?: $ instance ->getForeignKey () . ' s ' ;
310
+ $ relatedPivotKey = $ relatedPivotKey ?: Str:: plural ( $ instance ->getForeignKey ()) ;
311
311
312
312
// If no table name was provided, we can guess it by concatenating the two
313
313
// models using underscores in alphabetical order. The two model names
You can’t perform that action at this time.
0 commit comments