isSortable = true; $this->sortColumns = $condition; } else { $this->isSortable = $condition; $this->sortColumns = null; } $this->sortQuery = $query; return $this; } public function getSortColumns(): array { return $this->sortColumns ?? $this->getDefaultSortColumns(); } public function isSortable(): bool { return $this->isSortable; } protected function getDefaultSortColumns(): array { return [Str::of($this->getName())->afterLast('.')]; } }