Skip to content

Commit 700ba86

Browse files
committed
wip
1 parent 3988f8e commit 700ba86

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

config/user-monitoring.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
'visit_monitoring' => [
2020
'table' => 'visits_monitoring',
2121

22+
/*
23+
* If you want to disable visit monitoring, you can change it to false.
24+
*/
25+
'turn_on' => true,
26+
2227
/*
2328
* You can specify pages not to be monitored.
2429
*/

src/Middlewares/VisitMonitoringMiddleware.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ class VisitMonitoringMiddleware
1919
*/
2020
public function handle(Request $request, Closure $next)
2121
{
22+
if (config('user-monitoring.visit_monitoring.turn_on', false) === false) {
23+
return $next($request);
24+
}
25+
2226
$agent = new Agent();
2327
$guard = config('user-monitoring.user.guard', 'web');
2428
$exceptPages = config('user-monitoring.visit_monitoring.expect_pages', []);
@@ -51,4 +55,4 @@ private function checkIsExpectPages(string $page, array $exceptPages)
5155
{
5256
return collect($exceptPages)->contains($page);
5357
}
54-
}
58+
}

0 commit comments

Comments
 (0)