Controller -Endpoint List Usuarios
This commit is contained in:
parent
50d6108068
commit
d8e92ce7a9
@ -80,6 +80,15 @@ public function userProfile()
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function listUser(){
|
||||||
|
$users = User::all();
|
||||||
|
return response([
|
||||||
|
"status" => 1,
|
||||||
|
"msg" => "!Lista de usuarios",
|
||||||
|
"data" => $users,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
public function logout()
|
public function logout()
|
||||||
{
|
{
|
||||||
auth()->user()->tokens()->delete();
|
auth()->user()->tokens()->delete();
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
Route::middleware("auth:sanctum")->group(function () {
|
Route::middleware("auth:sanctum")->group(function () {
|
||||||
//rutas auth
|
//rutas auth
|
||||||
Route::get('user-profile', [UserController::class, 'userProfile']);
|
Route::get('user-profile', [UserController::class, 'userProfile']);
|
||||||
|
Route::get('user', [UserController::class, 'listUser']);
|
||||||
Route::get('logout', [UserController::class, 'logout']);
|
Route::get('logout', [UserController::class, 'logout']);
|
||||||
Route::post('register', [UserController::class, 'register']);
|
Route::post('register', [UserController::class, 'register']);
|
||||||
|
|
||||||
@ -116,6 +117,6 @@
|
|||||||
Route::get('narrativa', [NarrativasController::class, 'listNarrativas']);
|
Route::get('narrativa', [NarrativasController::class, 'listNarrativas']);
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
|
/*Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
|
||||||
return $request->user();
|
return $request->user();
|
||||||
});
|
});*/
|
||||||
|
Loading…
Reference in New Issue
Block a user