key; } /** * Get sort column. * * @return string */ public function getColumn(): string { return $this->column ?? $this->key; } /** * Determine if the column should be qualified for the sort. * * @return bool */ public function shouldQualifyColumn(): bool { return QualifyColumn::YES === $this->qualifyColumn; } /** * Format the sort based on direction. * * @param Direction $direction * @return string */ public function format(Direction $direction): string { return match ($direction) { Direction::ASCENDING => $this->getKey(), Direction::DESCENDING => "-{$this->getKey()}", }; } }