Yajra\Datatables\Html\Builder::addIndex PHP Method

addIndex() public method

Add a index column.
public addIndex ( array $attributes = [] )
$attributes array
    public function addIndex(array $attributes = [])
    {
        $indexColumn = Config::get('datatables.index_column', 'DT_Row_Index');
        $attributes = array_merge(['defaultContent' => '', 'data' => $indexColumn, 'name' => $indexColumn, 'title' => '', 'render' => null, 'orderable' => false, 'searchable' => false, 'exportable' => false, 'printable' => true, 'footer' => ''], $attributes);
        $this->collection->push(new Column($attributes));
        return $this;
    }