url = route('Admin.Shop.CustomerAddresses.index'); } public function query(CustomerAddress $model) { $model = self::filterByCustomer($model); return $this->buildQuery($model); } public static function filterByCustomer($model, $customerId = false) { $customerId = $customerId ? $customerId : self::isFilteredByField('customer_id'); 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'), $this->makeColumnButtons(), ]; } }