Skip to content

Commit 726e2ff

Browse files
committed
Update Actionable.php
1 parent f721646 commit 726e2ff

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Traits/Actionable.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ protected static function boot(): void
6363
*/
6464
private static function insertActionMonitoring(mixed $model, string $actionType): void
6565
{
66-
$detector = new Detector();
66+
$detector = new Detector;
6767
$guard = config('user-monitoring.user.guard');
6868

6969
DB::table(config('user-monitoring.action_monitoring.table'))->insert([
@@ -73,7 +73,7 @@ private static function insertActionMonitoring(mixed $model, string $actionType)
7373
'browser_name' => $detector->getBrowser(),
7474
'platform' => $detector->getDevice(),
7575
'device' => $detector->getDevice(),
76-
'ip' => $this->getRealIP(),
76+
'ip' => self::getRealIP(),
7777
'page' => request()->url(),
7878
'created_at' => now(),
7979
'updated_at' => now(),
@@ -83,10 +83,10 @@ private static function insertActionMonitoring(mixed $model, string $actionType)
8383
/**
8484
* Get real ip.
8585
*/
86-
private function getRealIP(): string
86+
private static function getRealIP(): string
8787
{
88-
return config('user-monitoring.use_reverse_proxy_ip')
89-
? request()->header(config('user-monitoring.real_ip_header')) ?: request()->ip() ?: request()->ip()
88+
return config('user-monitoring.use_reverse_proxy_ip')
89+
? request()->header(config('user-monitoring.real_ip_header')) ?: request()->ip()
9090
: request()->ip();
9191
}
9292
}

0 commit comments

Comments
 (0)