/** * @param \Witty\LaravelTableView\LaravelTableViewColumn $column * @return void */ public function setDefault($column) { $this->newDefaults($column->propertyName(), $column->defaultSortingDirectionIsAscending()); }
/** * Add a column to the table * * @param mixed $title * @param mixed $value * @return Witty\LaravelTableView\LaravelTableView */ public function column($title, $value = null) { $newColumn = new LaravelTableViewColumn($title, $value); $this->columns[] = $newColumn; if ($newColumn->isSearchable()) { $this->searchRepo->field($newColumn->propertyName()); } if ($newColumn->isDefaultSort()) { $this->sortRepo->setDefault($newColumn); } return $this; }