yajra datables - Merge Column values orderable not working Laravel

Viewed 89

it does not work when clicking on the column header nothing changed no sorting at all !!

public function dataTable($query)
{
    return datatables()
        ->eloquent($query)
        ->addColumn('customer_name', function($customer){
            return $customer->first_name.' '.$customer->last_name;
        })
        
        })->rawColumns(['createdAt', 'action']);
}

sorting and search does not working.

    protected function getColumns()
    {
     return [
         'id', 
         'customer_name'=>[
           'data'=>'customer_name',
         ]
     ];
    }
1 Answers

i'think sorting and search not working in concate column yajra datables.

Related