Skip to content

Commit

Permalink
fix laravel version
Browse files Browse the repository at this point in the history
  • Loading branch information
bluehaha committed Nov 21, 2019
1 parent 48131e4 commit 4cb1ec3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}
],
"require": {
"illuminate/database": ">=5.*"
"illuminate/database": ">=5.8.0"
},
"require-dev": {
"orchestra/testbench": "3.*",
Expand Down
4 changes: 2 additions & 2 deletions src/EloquentJoinBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ private function performJoin($relations, $leftJoin = null)
if (!in_array($relationAccumulatedString, $this->joinedTables)) {
$joinQuery = $relatedTable.($this->useTableAlias ? ' as '.$relatedTableAlias : '');
if ($relatedRelation instanceof BelongsTo) {
$relatedKey = $relatedRelation->getQualifiedForeignKey();
$relatedKey = $relatedRelation->getQualifiedForeignKeyName();
$relatedKey = last(explode('.', $relatedKey));
$ownerKey = $relatedRelation->getOwnerKey();
$ownerKey = $relatedRelation->getOwnerKeyName();

$this->$joinMethod($joinQuery, function ($join) use ($relatedRelation, $relatedTableAlias, $relatedKey, $currentTableAlias, $ownerKey) {
$join->on($relatedTableAlias.'.'.$ownerKey, '=', $currentTableAlias.'.'.$relatedKey);
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

abstract class TestCase extends \Orchestra\Testbench\TestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down

0 comments on commit 4cb1ec3

Please sign in to comment.