enhance invoice display
This commit is contained in:
@@ -9,7 +9,7 @@ use Yajra\DataTables\Html\Column;
|
||||
|
||||
class InvoicesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'Invoices';
|
||||
public $model_name = 'invoices';
|
||||
|
||||
public function query(Invoice $model)
|
||||
{
|
||||
@@ -28,7 +28,7 @@ class InvoicesDataTable extends DataTable
|
||||
return $invoice->created_at->toDateTimeString();
|
||||
})
|
||||
->editColumn('customer.last_name', function (Invoice $invoice) {
|
||||
return ($invoice->customer ?? false) ? $invoice->customer->last_name.' '.$invoice->customer->first_name : '';
|
||||
return ($invoice->customer ?? false) ? $invoice->customer->name : '';
|
||||
})
|
||||
->rawColumns(['action']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user