feat: Remove the entire frontend customer portal and its associated controllers, while updating customer repositories and adding a cache table migration.

This commit is contained in:
pbao9
2026-02-16 16:19:22 +07:00
parent 4510cdc8eb
commit 4dae15ffca
110 changed files with 160 additions and 11121 deletions
@@ -11,14 +11,18 @@ class CustomerRepository extends BaseRepository implements CustomerRepositoryInt
{
return Customer::class;
}
public function filter(array $data = [], array $relationships = [], array $withCount = [], array $select = ['*'])
{
public function filter(
array $data = [],
array $relationships = [],
array $withCount = [],
array $select = ['*'],
bool $returnQuery = false
) {
$model = $this->model->with($relationships)->select($select);
if (isset($data['name']) && ! empty($data['name'])) {
$model = $model->where(function ($query) use ($data) {
$name = trim($data['name']);
$query->where("firstname", "LIKE", "%$name%");
$query->orWhere("lastname", "LIKE", "%$name%");
$query->where("fullname", "LIKE", "%$name%");
$query->orWhere("company", "LIKE", "%$name%");
});
}
@@ -59,6 +63,9 @@ class CustomerRepository extends BaseRepository implements CustomerRepositoryInt
if (count($withCount) > 0) {
$model = $model->withCount($withCount);
}
if ($returnQuery) {
return $model;
}
if (isset($data['page'])) {
return $model->paginate(15);
}