Skip to content

Commit 3626c36

Browse files
committed
Update pluralizing logic in HybridRelations;
1 parent b3779a1 commit 3626c36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Eloquent/HybridRelations.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,11 @@ public function belongsToMany(
303303
// First, we'll need to determine the foreign key and "other key" for the
304304
// relationship. Once we have determined the keys we'll make the query
305305
// instances as well as the relationship instances we need for this.
306-
$foreignPivotKey = $foreignPivotKey ?: $this->getForeignKey() . 's';
306+
$foreignPivotKey = $foreignPivotKey ?: Str::plural($this->getForeignKey());
307307

308308
$instance = new $related();
309309

310-
$relatedPivotKey = $relatedPivotKey ?: $instance->getForeignKey() . 's';
310+
$relatedPivotKey = $relatedPivotKey ?: Str::plural($instance->getForeignKey());
311311

312312
// If no table name was provided, we can guess it by concatenating the two
313313
// models using underscores in alphabetical order. The two model names

0 commit comments

Comments
 (0)