diff --git a/src/Sorts/CaseSort.php b/src/Sorts/CaseSort.php index fbd86ed..389814e 100644 --- a/src/Sorts/CaseSort.php +++ b/src/Sorts/CaseSort.php @@ -66,6 +66,12 @@ protected function getQueryExpression(string $column): string { $sql = 'case '; foreach ($this->cases as $key => $value) { + if (is_string($key)) { + $sql .= "when {$column} = '{$key}' then '{$value}' "; + + continue; + } + $sql .= "when {$column} = {$key} then '{$value}' "; } $sql .= 'end ';