From a2f8f6220f19a06c65a298ace56de8a05d0deea0 Mon Sep 17 00:00:00 2001 From: Mohammad Hafijul Islam Date: Sun, 8 Oct 2023 01:13:01 +0600 Subject: [PATCH] sorting issue fixed --- src/Repositories/Eloquent/PermissionRepository.php | 2 +- src/Repositories/Eloquent/ProfileRepository.php | 2 +- src/Repositories/Eloquent/RoleRepository.php | 2 +- src/Repositories/Eloquent/TeamRepository.php | 2 +- src/Repositories/Eloquent/UserRepository.php | 2 +- src/Repositories/Mongodb/PermissionRepository.php | 2 +- src/Repositories/Mongodb/ProfileRepository.php | 2 +- src/Repositories/Mongodb/RoleRepository.php | 2 +- src/Repositories/Mongodb/TeamRepository.php | 2 +- src/Repositories/Mongodb/UserRepository.php | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Repositories/Eloquent/PermissionRepository.php b/src/Repositories/Eloquent/PermissionRepository.php index b097acd..0035e9b 100644 --- a/src/Repositories/Eloquent/PermissionRepository.php +++ b/src/Repositories/Eloquent/PermissionRepository.php @@ -49,7 +49,7 @@ public function list(array $filters = []) } //Handle Sorting - $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['direction'] ?? 'asc'); + $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['dir'] ?? 'asc'); //Prepare Output return (isset($filters['paginate']) && $filters['paginate'] == true) diff --git a/src/Repositories/Eloquent/ProfileRepository.php b/src/Repositories/Eloquent/ProfileRepository.php index 6585913..8184a31 100644 --- a/src/Repositories/Eloquent/ProfileRepository.php +++ b/src/Repositories/Eloquent/ProfileRepository.php @@ -49,7 +49,7 @@ public function list(array $filters = []) } //Handle Sorting - $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['direction'] ?? 'asc'); + $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['dir'] ?? 'asc'); //Prepare Output return (isset($filters['paginate']) && $filters['paginate'] == true) diff --git a/src/Repositories/Eloquent/RoleRepository.php b/src/Repositories/Eloquent/RoleRepository.php index ab4dcbd..38917ea 100644 --- a/src/Repositories/Eloquent/RoleRepository.php +++ b/src/Repositories/Eloquent/RoleRepository.php @@ -61,7 +61,7 @@ public function list(array $filters = []) } //Handle Sorting - $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['direction'] ?? 'asc'); + $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['dir'] ?? 'asc'); //Prepare Output return (isset($filters['paginate']) && $filters['paginate'] == true) diff --git a/src/Repositories/Eloquent/TeamRepository.php b/src/Repositories/Eloquent/TeamRepository.php index 757e5fb..7082bd9 100644 --- a/src/Repositories/Eloquent/TeamRepository.php +++ b/src/Repositories/Eloquent/TeamRepository.php @@ -53,7 +53,7 @@ public function list(array $filters = []) } //Handle Sorting - $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['direction'] ?? 'asc'); + $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['dir'] ?? 'asc'); //Prepare Output return (isset($filters['paginate']) && $filters['paginate'] == true) diff --git a/src/Repositories/Eloquent/UserRepository.php b/src/Repositories/Eloquent/UserRepository.php index 2a16557..9b1fd4b 100644 --- a/src/Repositories/Eloquent/UserRepository.php +++ b/src/Repositories/Eloquent/UserRepository.php @@ -49,7 +49,7 @@ public function list(array $filters = []) } //Handle Sorting - $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['direction'] ?? 'asc'); + $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['dir'] ?? 'asc'); //Prepare Output return (isset($filters['paginate']) && $filters['paginate'] == true) diff --git a/src/Repositories/Mongodb/PermissionRepository.php b/src/Repositories/Mongodb/PermissionRepository.php index eb09255..1a68c49 100644 --- a/src/Repositories/Mongodb/PermissionRepository.php +++ b/src/Repositories/Mongodb/PermissionRepository.php @@ -35,7 +35,7 @@ public function list(array $filters = []) $query = $this->model->newQuery(); //Handle Sorting - $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['direction'] ?? 'asc'); + $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['dir'] ?? 'asc'); //Prepare Output return (isset($filters['paginate']) && $filters['paginate'] == true) diff --git a/src/Repositories/Mongodb/ProfileRepository.php b/src/Repositories/Mongodb/ProfileRepository.php index 314fea9..34bd4ce 100644 --- a/src/Repositories/Mongodb/ProfileRepository.php +++ b/src/Repositories/Mongodb/ProfileRepository.php @@ -37,7 +37,7 @@ public function list(array $filters = []) $query = $this->model->newQuery(); //Handle Sorting - $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['direction'] ?? 'asc'); + $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['dir'] ?? 'asc'); //Prepare Output return (isset($filters['paginate']) && $filters['paginate'] == true) diff --git a/src/Repositories/Mongodb/RoleRepository.php b/src/Repositories/Mongodb/RoleRepository.php index 66475e6..4143983 100644 --- a/src/Repositories/Mongodb/RoleRepository.php +++ b/src/Repositories/Mongodb/RoleRepository.php @@ -35,7 +35,7 @@ public function list(array $filters = []) $query = $this->model->newQuery(); //Handle Sorting - $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['direction'] ?? 'asc'); + $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['dir'] ?? 'asc'); //Prepare Output return (isset($filters['paginate']) && $filters['paginate'] == true) diff --git a/src/Repositories/Mongodb/TeamRepository.php b/src/Repositories/Mongodb/TeamRepository.php index 9712777..1a260f8 100644 --- a/src/Repositories/Mongodb/TeamRepository.php +++ b/src/Repositories/Mongodb/TeamRepository.php @@ -35,7 +35,7 @@ public function list(array $filters = []) $query = $this->model->newQuery(); //Handle Sorting - $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['direction'] ?? 'asc'); + $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['dir'] ?? 'asc'); //Prepare Output return (isset($filters['paginate']) && $filters['paginate'] == true) diff --git a/src/Repositories/Mongodb/UserRepository.php b/src/Repositories/Mongodb/UserRepository.php index a11617a..4097154 100644 --- a/src/Repositories/Mongodb/UserRepository.php +++ b/src/Repositories/Mongodb/UserRepository.php @@ -36,7 +36,7 @@ public function list(array $filters = []) $query = $this->model->newQuery(); //Handle Sorting - $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['direction'] ?? 'asc'); + $query->orderBy($filters['sort'] ?? $this->model->getKeyName(), $filters['dir'] ?? 'asc'); if (isset($filters['login_id']) && ! empty($filters['login_id'])) { $query->where('login_id', $filters['login_id'])->limit(1);