Skip to content

Commit

Permalink
[5.x] Fix CP Asset Sort After Search issue (#10709)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielml01 committed Sep 2, 2024
1 parent 6a8aaa3 commit 7de6672
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Http/Controllers/CP/Assets/BrowserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ public function search(Request $request, $container, $path = null)
$query->where('folder', $path);
}

if ($request->sort) {
$query->orderBy($request->sort, $request->order ?? 'asc');
}

$this->applyQueryScopes($query, $request->all());

$assets = $query->paginate(request('perPage'));
Expand Down

0 comments on commit 7de6672

Please sign in to comment.