Skip to content

Commit

Permalink
Fix method name for L5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dvlpp committed Sep 25, 2017
1 parent ae8bc73 commit a1d1ed5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ function updateEntity(SharpCmsRepository $sharpRepository, $categoryKey, $entity
$singleRelationBelongsTo->save();
// And then attach the foreign key
$lk = $instance->$relationKey()->getForeignKey();
$fk = $instance->$relationKey()->getOtherKey();

$ownerKeyMethodName = is_at_least_laravel_54()
? "getOwnerKey"
: "getOtherKey";

$fk = $instance->$relationKey()->$ownerKeyMethodName();
$instance->$lk = $singleRelationBelongsTo->$fk;
}

Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.8
3.2.9

0 comments on commit a1d1ed5

Please sign in to comment.