feat: Implement soft deletes for customer, invoice, order, and transaction models, and add customer edit and trash management to the admin panel.
This commit is contained in:
@@ -67,4 +67,9 @@ class CustomerCachedRepository extends BaseCachedRepository implements CustomerR
|
||||
return $this->customerRepository->findBy($key, $value);
|
||||
});
|
||||
}
|
||||
|
||||
public function onlyTrashed(array $relationships = [], array $withCount = [])
|
||||
{
|
||||
return $this->customerRepository->onlyTrashed($relationships, $withCount);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,4 +125,15 @@ class CustomerRepository extends BaseRepository implements CustomerRepositoryInt
|
||||
}
|
||||
return $this->model->where($key, $value)->first();
|
||||
}
|
||||
|
||||
public function onlyTrashed(array $relationships = [], array $withCount = [])
|
||||
{
|
||||
$query = $this->model->with($relationships);
|
||||
|
||||
if (count($withCount) > 0) {
|
||||
$query = $query->withCount($withCount);
|
||||
}
|
||||
|
||||
return $query->onlyTrashed();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,4 +15,5 @@ interface CustomerRepositoryInterface extends BaseRepositoryInterface
|
||||
);
|
||||
public function findWithRelationships(int $id = 0, array $relationships = [],array $withCount = [], array $withSum = []);
|
||||
public function findBy(string $key = '',string $value = '');
|
||||
public function onlyTrashed(array $relationships = [], array $withCount = []);
|
||||
}
|
||||
Reference in New Issue
Block a user