app/DataTables/TripsDataTable.php
/**
     * Optional method if you want to use html builder.
     *
     * @return \Yajra\DataTables\Html\Builder
     */
Optional method if you want to use html builder.
Optional method if you want to use html builder .
public function html()
    {
        return $this->builder()
            ->setTableId('trips-table')
            ->columns($this->getColumns())
            ->minifiedAjax()
            ->dom('Bfrtip')
            ->orderBy(0)
            ->buttons(
                Button::raw([
                    'text' => 'Create',
                    'action' => 'function(){location.href="' . route('trip.create') . '"}'
                ]),
                Button::make('export'),
                Button::make('print'),
                Button::make('reset'),
                Button::make('reload')
            );
    }
public function html ( ) { return $ this -> builder ( ) -> setTableId ( 'trips-table' ) -> columns ( $ this -> getColumns ( ) ) -> minifiedAjax ( ) -> dom ( 'Bfrtip' ) -> orderBy ( 0 ) -> buttons ( Button :: raw ( [ 'text' => 'Create' , 'action' => 'function(){location.href="' . route ( 'trip.create' ) . '"}' ] ) , Button :: make ( 'export' ) , Button :: make ( 'print' ) , Button :: make ( 'reset' ) , Button :: make ( 'reload' ) ) ; }
Optional method if you want to use html builder.
Optional method if you want to use html builder .