@@ -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