fixes
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Datatables\Admin\Shop;
|
||||
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\CustomerAddress;
|
||||
use App\Repositories\Shop\CustomerAddresses;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class CustomerAddressesDataTable extends DataTable
|
||||
@@ -29,10 +30,20 @@ class CustomerAddressesDataTable extends DataTable
|
||||
return $customerId ? $model->byCustomer($customerId) : $model;
|
||||
}
|
||||
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables->editColumn('type', function (CustomerAddress $address) {
|
||||
return CustomerAddresses::getIconByType($address->type);
|
||||
})->rawColumns(['type', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('type')->title('')->width(30),
|
||||
Column::make('address')->title('Adresse'),
|
||||
Column::make('zipcode')->title('Code postal'),
|
||||
Column::make('city')->title('Ville'),
|
||||
|
||||
Reference in New Issue
Block a user