Skip to content

Commit

Permalink
Fix sort array url query (#1835)
Browse files Browse the repository at this point in the history
* Fix SortingHelpers

* Fix styling

---------

Co-authored-by: lrljoe <lrljoe@users.noreply.github.com>
  • Loading branch information
lrljoe and lrljoe authored Aug 10, 2024
1 parent 88d7700 commit 6f5bdc6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `laravel-livewire-tables` will be documented in this file

## [v3.4.5] - 2024-08-10
### Bug Fixes
- Fix sort queryString bug by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1835

## [v3.4.4] - 2024-08-10
### New Features
- Boolean/Toggle Filter by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1830
Expand Down
10 changes: 10 additions & 0 deletions src/Traits/Helpers/SortingHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ public function getSingleSortingStatus(): bool

public function getSorts(): array
{
foreach ($this->sorts as $column => $direction) {
if (is_array($direction)) {
foreach ($direction as $colAppend => $actualDirection) {
$this->sorts[$column.'.'.$colAppend] = $actualDirection;
unset($this->sorts[$column]);
}
}

}

return $this->sorts;
}

Expand Down

0 comments on commit 6f5bdc6

Please sign in to comment.