We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
getUserId
1 parent 8751a2e commit c0601bbCopy full SHA for c0601bb
src/Utills/UserUtils.php
@@ -53,12 +53,14 @@ public static function getCurrentGuardName(): ?string
53
*/
54
public static function getUserId(): ?int
55
{
56
- $guards = config('user-monitoring.user.guard', ['web']);
+ $guards = config('user-monitoring.user.guards', ['web']);
57
58
foreach ($guards as $guard) {
59
- if (Auth::guard($guard)->check()) {
60
- return Auth::guard($guard)->id();
61
- }
+ try {
+ if (Auth::guard($guard)->check()) {
+ return Auth::guard($guard)->id();
62
+ }
63
+ } catch (\Exception $e) {}
64
}
65
66
return null;
0 commit comments