Skip to content

Commit

Permalink
Merge pull request #5624 from Laravel-Backpack/fix-string-wrapping
Browse files Browse the repository at this point in the history
remove raw order, let eloquent process the ordering
  • Loading branch information
pxpm authored Aug 19, 2024
2 parents d8a5303 + f2f7fd8 commit d036a3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/Library/CrudPanel/Traits/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function orderByWithPrefix($column_name, $column_direction = 'asc')
$column_direction = strtolower($column_direction);

if ($this->query->getQuery()->joins !== null) {
return $this->query->orderByRaw("\"{$this->model->getTableWithPrefix()}\".\"{$column_name}\" {$column_direction}");
return $this->query->orderBy("{$this->model->getTableWithPrefix()}.{$column_name}", $column_direction);
}

return $this->query->orderBy($column_name, $column_direction);
Expand Down

0 comments on commit d036a3f

Please sign in to comment.