Skip to content

Commit

Permalink
Merge pull request #5666 from Laravel-Backpack/avoid-casting-the-key-…
Browse files Browse the repository at this point in the history
…to-int

do not cast the items key to int
  • Loading branch information
pxpm authored Sep 18, 2024
2 parents 7d0b79c + e3d80c8 commit 088bfc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/Library/CrudPanel/Traits/Reorder.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public function updateTreeOrder($request)
$reorderItems = collect($request)->filter(function ($item) use ($itemKeys) {
return $item['item_id'] !== '' && $item['item_id'] !== null && $itemKeys->contains($item['item_id']);
})->map(function ($item) use ($primaryKey) {
$item[$primaryKey] = (int) $item['item_id'];
$item['parent_id'] = empty($item['parent_id']) ? null : (int) $item['parent_id'];
$item[$primaryKey] = $item['item_id'];
$item['parent_id'] = empty($item['parent_id']) ? null : $item['parent_id'];
$item['depth'] = empty($item['depth']) ? null : (int) $item['depth'];
$item['lft'] = empty($item['left']) ? null : (int) $item['left'];
$item['rgt'] = empty($item['right']) ? null : (int) $item['right'];
Expand Down

0 comments on commit 088bfc6

Please sign in to comment.