diff --git a/src/Dvlpp/Sharp/Repositories/AutoUpdater/SharpEloquentAutoUpdaterService.php b/src/Dvlpp/Sharp/Repositories/AutoUpdater/SharpEloquentAutoUpdaterService.php index cf28861..52c0a5f 100644 --- a/src/Dvlpp/Sharp/Repositories/AutoUpdater/SharpEloquentAutoUpdaterService.php +++ b/src/Dvlpp/Sharp/Repositories/AutoUpdater/SharpEloquentAutoUpdaterService.php @@ -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; } diff --git a/version.txt b/version.txt index 132d9f7..df4bdc7 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -3.2.8 \ No newline at end of file +3.2.9 \ No newline at end of file