Skip to content

Commit

Permalink
feat: (BE) : get all users #18
Browse files Browse the repository at this point in the history
  • Loading branch information
highfrezh committed Nov 18, 2022
1 parent bc38cb0 commit 7922ce2
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 170 deletions.
11 changes: 10 additions & 1 deletion backend/app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Controllers\User;
namespace App\Http\Controllers;

use App\Models\User;
use function response;
Expand All @@ -11,6 +11,15 @@

class UserController extends Controller
{
public function allUsers()
{
$user = User::paginate(15);
return response()->json([
'status' => true,
'data' => $user
], 200);
}

public function getUserById($user_id): JsonResponse
{
if (User::where('id', $user_id)->exists())
Expand Down
Loading

0 comments on commit 7922ce2

Please sign in to comment.