Skip to content

Commit

Permalink
Merge pull request #475 from Muhammad235/edit/users-stats-ednpoint
Browse files Browse the repository at this point in the history
edit: users stats endpoint
  • Loading branch information
tulbadex authored Aug 9, 2024
2 parents c985196 + ed483ab commit bf7b32c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions app/Http/Controllers/Api/V1/User/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ public function stats()
[
"status_code" => 200,
"message" => "User statistics retrieved successfully",
"total_users" => $totalUsers,
"deleted_users" => $totalDeletedUsers,
"active_users" => $totalActiveUsers,
"in_active_users" => $totalInActiveUsers,
"data" => [
"total_users" => $totalUsers,
"deleted_users" => $totalDeletedUsers,
"active_users" => $totalActiveUsers,
"in_active_users" => $totalInActiveUsers,
]
],
200
);
Expand All @@ -34,14 +36,13 @@ public function stats()
*/
public function index()
{
$users = User::latest()->paginate();

$users = User::paginate();

return response()->json(
[
"status_code" => 200,
"message" => "Users returned successfully",
"data" =>$users
"data" => $users
],
200
);
Expand Down

0 comments on commit bf7b32c

Please sign in to comment.