user logs update

This commit is contained in:
Pringgosutono
2025-10-20 15:36:39 +07:00
parent fbbcf86509
commit 81efe25ce2
20 changed files with 650 additions and 52 deletions

View File

@ -144,6 +144,11 @@ class LoginController extends Controller
// return $req->wantsJson()
// ? new JsonResponse([], 204)
// : redirect(route('view_dashboard'));
$log = [
"module" => "Auth",
"action" => "Login",
"desc" => "User login",
];
UserLogs::insert(Auth::user()->id, "User login");
if ($req->wantsJson()) {
@ -175,6 +180,11 @@ class LoginController extends Controller
public function logout(Request $req)
{
$user = Auth::user();
$log = [
"module" => "Auth",
"action" => "Logout",
"desc" => "User logout",
];
UserLogs::insert(Auth::user()->id, "User logout");
if ($user->role == Users::ROLE_ADMIN) {