/** * Updates user's last access time */ public function onUserAccess() { if ($user = App::user() and $user->isAuthenticated()) { User::updateAccess($user); } }