Skip to content

Commit

Permalink
sort by json columns
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Mar 3, 2021
1 parent 74ca990 commit bba8119
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Concerns/Filterable.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function scopeState(Builder $query, string $value): Builder
public function scopeSort(Builder $query, array $value = []): Builder
{
return $query->orderBy(
$query->qualifyColumn($value['by'] ?? 'created_at'),
$query->qualifyColumn(str_replace('.', '->', $value['by'] ?? 'created_at')),
$value['order'] ?? 'desc'
);
}
Expand Down

0 comments on commit bba8119

Please sign in to comment.