File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 44
55use Binafy \LaravelUserMonitoring \Utills \ActionType ;
66use Binafy \LaravelUserMonitoring \Utills \Detector ;
7+ use Binafy \LaravelUserMonitoring \Utills \UserUtils ;
78use Illuminate \Support \Facades \DB ;
89
910trait Actionable
@@ -64,16 +65,16 @@ protected static function boot(): void
6465 private static function insertActionMonitoring (mixed $ model , string $ actionType ): void
6566 {
6667 $ detector = new Detector ;
67- $ guard = config ('user-monitoring.user.guard ' );
6868
6969 DB ::table (config ('user-monitoring.action_monitoring.table ' ))->insert ([
70- 'user_id ' => auth ( $ guard )-> id (),
70+ 'user_id ' => UserUtils:: getUserId (),
7171 'action_type ' => $ actionType ,
7272 'table_name ' => $ model ->getTable (),
7373 'browser_name ' => $ detector ->getBrowser (),
7474 'platform ' => $ detector ->getDevice (),
7575 'device ' => $ detector ->getDevice (),
7676 'ip ' => self ::getRealIP (),
77+ 'user_guard ' => UserUtils::getCurrentGuardName (),
7778 'page ' => request ()->url (),
7879 'created_at ' => now (),
7980 'updated_at ' => now (),
You can’t perform that action at this time.
0 commit comments