Donations Appreciated

It's not how much we give but how much love we put into giving. - Mother Teresa

Click here to lend your support to: Laravel Datatables and make a donation at !

HtmlBuilderController.php - Html Builder with Plain Columns

IdNameEmailCreated AtUpdated At


public function getColumns(Datatables $datatables)
    $columns = ['id', 'name', 'email', 'created_at', 'updated_at'];

    if ($datatables->getRequest()->ajax()) {
        return $datatables->of(User::select($columns))->make(true);

    $html = $datatables->getHtmlBuilder()->columns($columns);

    return view('datatables.html.columns', compact('html'));


    {!! $html->table() !!}

    {!! $html->scripts() !!}