Skip to content

Commit

Permalink
Call find() on related model, not on the relation itself (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin authored Jul 7, 2023
1 parent f0b7cdf commit 94a426f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Database/Traits/HasSortableRelations.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ protected function updateRelationOrder(string $relationName, string|int|Model $i
if ($id instanceof Model) {
$record = $id;
} else {
$record = $relation->find($id);
$record = $relation->getRelated()->find($id);
}
$record->{$column} = (int)$order;
$record->save();
Expand Down

0 comments on commit 94a426f

Please sign in to comment.