Added created_at, updated_at, email while data response with roles

This commit is contained in:
dhanabalan
2025-07-28 18:33:15 +05:30
parent b4bf170c89
commit c0d13db2f3

View File

@@ -81,6 +81,9 @@ class UserController extends Controller
//$user = User::where('email', $email)->first();
if (Hash::check($header_pass, $existUser->password)) {
return response()->json([
'created_at' => $existUser->created_at->format('Y-m-d H:i:s'),
'updated_at' => $existUser->updated_at->format('Y-m-d H:i:s'),
'email' => $existUser->email,
'roles' => $existUser->roles()->pluck('name')->toArray()
], 200);
} else {