When I'm using the normal Query of datatable it perfectly works,
public function getHmoDatatable()
{
$Hmo = Hmo::query();
return Datatables::eloquent($Hmo)
->addColumn('action', function($row) {
return '<a href="/hmo/principal/'. $row->id .'/edit" class="btn btn-primary">Update</a>';
})
->make(true);
}
But when I'm using specific query like this attached, it doesnt work
public function getHmoPendingDatatable()
{
$Hmo = Hmo::getHmoPending();
return Datatables::eloquent($Hmo)
->addColumn('action', function($row) {
return '<a href="/hmo/principal/pending'. $row->id .'/edit" class="btn btn-primary">Update</a>';
})
->make(true);
}
What I did was follow the new way of https://github.com/yajra/laravel-datatables You can use whatever you need
Here is my Code