ajax()) {
return DataTables::of(Invoice::filter($filters))->addColumn('action', function ($invoice) {
return ' Edit';
})
->addColumn('checkbox', function ($invoice){
return '';
})
->rawColumns(['checkbox', 'action'])
->make(true);
}
$builder->addAction();
$builder->addCheckbox();
/**todo this is redundant, but keep in case we want to build this serverside*/
$html = $builder->columns([
['data' => 'checkbox', 'name' => 'checkbox', 'title' => '', 'searchable' => false, 'orderable' => false],
['data' => 'invoice_number', 'name' => 'invoice_number', 'title' => trans('texts.invoice_number'), 'visible'=> true],
['data' => 'invoice_date', 'name' => 'invoice_date', 'title' => trans('texts.invoice_date'), 'visible'=> true],
['data' => 'amount', 'name' => 'amount', 'title' => trans('texts.total'), 'visible'=> true],
['data' => 'balance', 'name' => 'balance', 'title' => trans('texts.balance'), 'visible'=> true],
['data' => 'due_date', 'name' => 'due_date', 'title' => trans('texts.due_date'), 'visible'=> true],
['data' => 'status_id', 'name' => 'status_id', 'title' => trans('texts.status'), 'visible'=> true],
['data' => 'action', 'name' => 'action', 'title' => '', 'searchable' => false, 'orderable' => false],
]);
$builder->ajax([
'url' => route('client.invoices.index'),
'type' => 'GET',
'data' => 'function(d) { d.key = "value"; }',
]);
$data['html'] = $html;
return view('portal.default.invoices.index', $data);
}
/**
* Display the specified resource.
*
* @param \App\Models\Invoice $invoice The invoice
*
* @return \Illuminate\Http\Response
*/
public function show(Invoice $invoice)
{
}
/**
* Perform bulk actions on the list view
*
* @return Collection
*/
public function bulk()
{
}
}