From 67e10a43c3a2f27ad346fc26cc59bc3d30dea3c4 Mon Sep 17 00:00:00 2001 From: cgonzalesmo Date: Thu, 27 Oct 2022 17:04:17 -0500 Subject: [PATCH] add rol al list user --- app/Http/Controllers/Api/UserController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Http/Controllers/Api/UserController.php b/app/Http/Controllers/Api/UserController.php index 3a1a6ae..c5cbee8 100644 --- a/app/Http/Controllers/Api/UserController.php +++ b/app/Http/Controllers/Api/UserController.php @@ -82,6 +82,9 @@ public function userProfile() public function listUser(){ $users = User::all(); + foreach ($users as $user) { + $user->rol=User::find($user->id)->roles[0]->name; + } return response([ "status" => 1, "msg" => "!Lista de usuarios",