Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Commit

Permalink
Add route to get
Browse files Browse the repository at this point in the history
  • Loading branch information
WillianDamasceno committed Jun 1, 2024
1 parent 0405df4 commit 5964c81
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@
return response()->json(['data' => $user->id]);
});

Route::get('/get', function () {
$user = User::find((int) request('id'));

return response()->json([
'name' => $user->name,
'email' => $user->email,
'password' => $user->password,
]);
});

Route::get('/delete', function () {
return response()->json(['data' => User::where('id', (int) request('id'))->delete()]);
});
Expand Down

0 comments on commit 5964c81

Please sign in to comment.