|
21 | 21 | - [Turn ON-OFF](#turn-on-off) |
22 | 22 | - [Views](#visit-monitoring-views) |
23 | 23 | - [Ajax Requests](#ajax-requests) |
| 24 | + - [Visit Monitoring Guest Mode](#visit-monitoring-guest-mode) |
24 | 25 | - [Action Monitoring](#action-monitoring) |
25 | 26 | - [Views](#action-monitoring-views) |
26 | 27 | - [Reverse Proxy Config](#action-monitoring-reverse-proxy-config) |
| 28 | + - [Action Monitoring Guest Mode](#action-monitoring-guest-mode) |
27 | 29 | - [Authentication Monitoring](#authentication-monitoring) |
28 | 30 | - [Views](#authentication-monitoring-views) |
29 | 31 | - [How to use in big projects](#how-to-use-in-big-projects) |
@@ -338,6 +340,27 @@ Maybe you may disable record visits for `Ajax` requests, you can use config to d |
338 | 340 |
|
339 | 341 | When set to false, Ajax requests will not be recorded. |
340 | 342 |
|
| 343 | +<a name="visit-monitoring-guest-mode"></a> |
| 344 | +### Visit Monitoring Guest Mode |
| 345 | + |
| 346 | +Determines whether to track and store `visits` for users who are not authenticated (guests). |
| 347 | +When set to `true`, the package will also monitor guest user activity. |
| 348 | +When set to `false`, only authenticated user visits will be recorded. |
| 349 | + |
| 350 | +```php |
| 351 | +/* |
| 352 | + * Configuration settings for visit monitoring. |
| 353 | + */ |
| 354 | +'visit_monitoring' => [ |
| 355 | + ... |
| 356 | + |
| 357 | + /* |
| 358 | + * Determines whether to store `visits` even when the user is not logged in. |
| 359 | + */ |
| 360 | + 'guest_mode' => true, |
| 361 | +], |
| 362 | +``` |
| 363 | + |
341 | 364 | <a name="action-monitoring"></a> |
342 | 365 | ## Action Monitoring |
343 | 366 |
|
@@ -385,48 +408,70 @@ If you want to disable some actions like created, you can use the config file: |
385 | 408 |
|
386 | 409 |  |
387 | 410 |
|
388 | | -<a name="authentication-monitoring"></a> |
389 | | -## Authentication Monitoring |
| 411 | +<a name="action-monitoring-reverse-proxy-config"></a> |
| 412 | +### Action Monitoring Reverse Proxy Config |
390 | 413 |
|
391 | | -Have you ever thought about monitoring the entry and exit of users of your application? Now you can :) <br> |
392 | | -If you want to monitor users when logging in or logout of your application, you need to migrate the migrations to the config file and change true for monitoring authentication. |
| 414 | +If you are using Reverse Proxy (Nginx or Cloudflare), you can use config to get real IP from a specific header like `X-Real-IP` or `X-Forwarded-For`: |
393 | 415 |
|
394 | 416 | ```php |
395 | | -'authentication_monitoring' => [ |
| 417 | +'action_monitoring' => [ |
396 | 418 | ... |
397 | 419 |
|
398 | 420 | /* |
399 | | - * Enable or disable monitoring of user login and logout events. |
400 | | - * Set to true to track these actions, or false to disable. |
| 421 | + * If your application is behind a reverse proxy (e.g., Nginx or Cloudflare), |
| 422 | + * enable this setting to fetch the real client IP from the proxy headers. |
401 | 423 | */ |
402 | | - 'on_login' => true, |
403 | | - 'on_logout' => true, |
| 424 | + 'use_reverse_proxy_ip' => false, |
| 425 | + |
| 426 | + /* |
| 427 | + * The header used by reverse proxies to forward the real client IP. |
| 428 | + * Common values are 'X-Forwarded-For' or 'X-Real-IP'. |
| 429 | + */ |
| 430 | + 'real_ip_header' => 'X-Forwarded-For', |
404 | 431 | ], |
405 | 432 | ``` |
406 | 433 |
|
407 | | -<a name="action-monitoring-reverse-proxy-config"></a> |
408 | | -### Action Monitoring Reverse Proxy Config |
| 434 | +<a name="action-monitoring-guest-mode"></a> |
| 435 | +### Action Monitoring Guest Mode |
409 | 436 |
|
410 | | -If you are using Reverse Proxy (Nginx or Cloudflare), you can use config to get real IP from a specific header like `X-Real-IP` or `X-Forwarded-For`: |
| 437 | +Determines whether to track and store `actions` for users who are not authenticated (guests). |
| 438 | +When set to `true`, the package will also monitor guest user activity. |
| 439 | +When set to `false`, only authenticated user visits will be recorded. |
411 | 440 |
|
412 | 441 | ```php |
| 442 | +/* |
| 443 | + * Configuration settings for action monitoring. |
| 444 | + */ |
413 | 445 | 'action_monitoring' => [ |
414 | 446 | ... |
415 | 447 |
|
416 | 448 | /* |
417 | | - * If your application is behind a reverse proxy (e.g., Nginx or Cloudflare), |
418 | | - * enable this setting to fetch the real client IP from the proxy headers. |
| 449 | + * Determines whether to store `actions` even when the user is not logged in. |
419 | 450 | */ |
420 | | - 'use_reverse_proxy_ip' => false, |
| 451 | + 'guest_mode' => true, |
| 452 | +], |
| 453 | +``` |
| 454 | + |
| 455 | +<a name="authentication-monitoring"></a> |
| 456 | +## Authentication Monitoring |
| 457 | + |
| 458 | +Have you ever thought about monitoring the entry and exit of users of your application? Now you can :) <br> |
| 459 | +If you want to monitor users when logging in or logout of your application, you need to migrate the migrations to the config file and change true for monitoring authentication. |
| 460 | + |
| 461 | +```php |
| 462 | +'authentication_monitoring' => [ |
| 463 | + ... |
421 | 464 |
|
422 | 465 | /* |
423 | | - * The header used by reverse proxies to forward the real client IP. |
424 | | - * Common values are 'X-Forwarded-For' or 'X-Real-IP'. |
| 466 | + * Enable or disable monitoring of user login and logout events. |
| 467 | + * Set to true to track these actions, or false to disable. |
425 | 468 | */ |
426 | | - 'real_ip_header' => 'X-Forwarded-For', |
| 469 | + 'on_login' => true, |
| 470 | + 'on_logout' => true, |
427 | 471 | ], |
428 | 472 | ``` |
429 | 473 |
|
| 474 | + |
430 | 475 | <a name="authentication-monitoring-views"></a> |
431 | 476 | ### Authentication Monitoring Views |
432 | 477 |
|
|
0 commit comments