This commit is contained in:
ludo
2024-03-03 22:52:00 +01:00
parent 26ca3eb3ca
commit 7b7295aed1
18 changed files with 465 additions and 353 deletions

View File

@@ -17,9 +17,19 @@ class CustomerAddressesDataTable extends DataTable
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;
}
protected function getColumns()
{
return [