Skip to content

Commit

Permalink
Merge pull request #203 from yemenifree/5.5
Browse files Browse the repository at this point in the history
support laravel 5.5
  • Loading branch information
jarektkaczyk authored Oct 13, 2017
2 parents 0e73277 + 00bd54b commit 389b6d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"require": {
"php": ">=5.6.4",
"sofa/hookable": "5.4.*",
"illuminate/database": "5.4.*"
"illuminate/database": "5.5.*"
},
"require-dev": {
"phpunit/phpunit": "4.5.0",
Expand All @@ -45,6 +45,13 @@
"Sofa\\Eloquence\\Tests\\": "tests"
}
},
"extra": {
"laravel": {
"providers": [
"Sofa\\Eloquence\\ServiceProvider"
]
}
},
"minimum-stability": "stable",
"scripts": {
"test": "phpunit && ./vendor/bin/phpcs src --standard=psr2 --report=diff --colors",
Expand Down
4 changes: 2 additions & 2 deletions src/Relations/Joiner.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ protected function joinIntermediate(Model $parent, Relation $relation, $type)
{
if ($relation instanceof BelongsToMany) {
$table = $relation->getTable();
$fk = $relation->getQualifiedForeignKeyName();
$fk = $relation->getQualifiedForeignPivotKeyName();
} else {
$table = $relation->getParent()->getTable();
$fk = $relation->getQualifiedFirstKeyName();
Expand Down Expand Up @@ -189,7 +189,7 @@ protected function getJoinKeys(Relation $relation)
}

if ($relation instanceof BelongsToMany) {
return [$relation->getQualifiedRelatedKeyName(), $relation->getRelated()->getQualifiedKeyName()];
return [$relation->getQualifiedRelatedPivotKeyName(), $relation->getRelated()->getQualifiedKeyName()];
}

if ($relation instanceof HasManyThrough) {
Expand Down

0 comments on commit 389b6d6

Please sign in to comment.