|
2 | 2 |
|
3 | 3 | return [ |
4 | 4 | /* |
5 | | - * Configurations. |
| 5 | + * Main configuration settings for the package. |
6 | 6 | */ |
7 | 7 | 'config' => [ |
8 | 8 | 'routes' => [ |
| 9 | + /* |
| 10 | + * Path to the route file that handles user monitoring routes. |
| 11 | + */ |
9 | 12 | 'file_path' => 'routes/user-monitoring.php', |
10 | 13 | ], |
11 | 14 | ], |
12 | 15 |
|
13 | 16 | /* |
14 | | - * User properties. |
| 17 | + * User-specific configuration settings. |
15 | 18 | * |
16 | | - * You can customize the user guard, table, foreign key, and ... |
| 19 | + * Customize various aspects related to the user model, including the guard, table, foreign key, and display attributes. |
17 | 20 | */ |
18 | 21 | 'user' => [ |
19 | 22 | /* |
20 | | - * User model. |
| 23 | + * Specify the fully qualified class name of the user model. |
21 | 24 | */ |
22 | 25 | 'model' => 'App\Models\User', |
23 | 26 |
|
24 | 27 | /* |
25 | | - * Foreign Key column name. |
| 28 | + * Name of the foreign key column linking user data to other models. |
26 | 29 | */ |
27 | 30 | 'foreign_key' => 'user_id', |
28 | 31 |
|
29 | 32 | /* |
30 | | - * Users table name. |
| 33 | + * Name of the table storing user data. |
31 | 34 | */ |
32 | 35 | 'table' => 'users', |
33 | 36 |
|
34 | 37 | /* |
35 | | - * You can customize which guards are used to authenticate or |
36 | | - * store user data across different parts of the application. Each guard |
37 | | - * will be checked independently, allowing users to be authenticated by |
38 | | - * multiple guards and enabling more flexible user management. |
39 | | - * |
40 | | - * Make sure that each guard is properly configured under the 'guards' section in the auth.php config file. |
| 38 | + * Defines the authentication guards used for verifying the user. |
| 39 | + * Multiple guards can be specified for flexible authentication strategies. |
| 40 | + * Ensure these guards are configured correctly in the 'guards' section of the auth.php config file. |
41 | 41 | */ |
42 | 42 | 'guards' => ['web'], |
43 | 43 |
|
44 | 44 | /* |
45 | | - * If you are using uuid or ulid you can change it for the type of foreign_key. |
46 | | - * |
47 | | - * When using ulid or uuid, you need to add related traits into the models. |
| 45 | + * Specify the type of foreign key being used (e.g., 'id', 'uuid', 'ulid'). |
| 46 | + * For non-standard IDs, make sure to add the relevant traits to your models. |
48 | 47 | */ |
49 | | - 'foreign_key_type' => 'id', // uuid, ulid, id |
| 48 | + 'foreign_key_type' => 'id', // Options: uuid, ulid, id |
50 | 49 |
|
51 | 50 | /* |
52 | | - * If you want to display a custom username, you can create your attribute in User and change this value. |
| 51 | + * Attribute of the user model used to display the user's name. |
| 52 | + * If you wish to use a different attribute (e.g., username), change this value accordingly. |
53 | 53 | */ |
54 | 54 | 'display_attribute' => 'name', |
55 | 55 | ], |
56 | 56 |
|
57 | 57 | /* |
58 | | - * Visit monitoring configurations. |
| 58 | + * Configuration settings for visit monitoring. |
59 | 59 | */ |
60 | 60 | 'visit_monitoring' => [ |
| 61 | + /* |
| 62 | + * The table where visit data will be stored. |
| 63 | + */ |
61 | 64 | 'table' => 'visits_monitoring', |
62 | 65 |
|
63 | 66 | /* |
64 | | - * If you want to disable visit monitoring, set it to false. |
| 67 | + * Enable or disable the visit monitoring feature. |
| 68 | + * Set to false to disable tracking of user visits. |
65 | 69 | */ |
66 | 70 | 'turn_on' => true, |
67 | 71 |
|
68 | 72 | /* |
69 | | - * If you want to disable visit monitoring in Ajax mode, set it to false. |
| 73 | + * Enable or disable monitoring for AJAX requests. |
| 74 | + * Set to false if you do not wish to track AJAX-based page loads. |
70 | 75 | */ |
71 | 76 | 'ajax_requests' => true, |
72 | 77 |
|
73 | 78 | /* |
74 | | - * You can specify pages not to be monitored. |
| 79 | + * List of pages that should be excluded from visit monitoring. |
| 80 | + * Add route names or URL paths to this array if you want to exclude certain pages. |
75 | 81 | */ |
76 | 82 | 'except_pages' => [ |
77 | | - 'user-monitoring/visits-monitoring', |
78 | | - 'user-monitoring/actions-monitoring', |
79 | | - 'user-monitoring/authentications-monitoring', |
| 83 | + 'user-monitoring/visits-monitoring', |
| 84 | + 'user-monitoring/actions-monitoring', |
| 85 | + 'user-monitoring/authentications-monitoring', |
80 | 86 | ], |
81 | 87 |
|
82 | 88 | /* |
83 | | - * If you want to delete visit rows after some days, you can change this to 360 for example, |
84 | | - * but if you don't like to delete rows you can change it to 0. |
| 89 | + * Set the number of days after which visit records should be automatically deleted. |
| 90 | + * Set to 0 to disable automatic deletion. |
85 | 91 | * |
86 | | - * For this feature you need Task-Scheduling => https://laravel.com/docs/10.x/scheduling |
| 92 | + * To enable automatic deletion, configure Laravel's task scheduling as outlined here: |
| 93 | + * https://laravel.com/docs/10.x/scheduling |
87 | 94 | */ |
88 | 95 | 'delete_days' => 0, |
89 | 96 | ], |
90 | 97 |
|
91 | 98 | /* |
92 | | - * Action monitoring configurations. |
| 99 | + * Configuration settings for action monitoring. |
93 | 100 | */ |
94 | 101 | 'action_monitoring' => [ |
| 102 | + /* |
| 103 | + * The table where action data (e.g., store, update, delete) will be stored. |
| 104 | + */ |
95 | 105 | 'table' => 'actions_monitoring', |
96 | 106 |
|
97 | 107 | /* |
98 | | - * Monitor actions. |
99 | | - * |
100 | | - * You can set true/false for monitor actions like (store, update, and ...). |
| 108 | + * Enable or disable monitoring of specific actions (e.g., store, update, delete). |
| 109 | + * Set to true to monitor actions or false to disable. |
101 | 110 | */ |
102 | 111 | 'on_store' => true, |
103 | 112 | 'on_update' => true, |
|
106 | 115 | 'on_restore' => false, |
107 | 116 | 'on_replicate' => false, |
108 | 117 |
|
109 | | - /** |
110 | | - * Determines if the application should use reverse proxy headers to fetch the real client IP |
111 | | - * If set to true, it will try to get the IP from the specified header (X-Real-IP or X-Forwarded-For) |
112 | | - * This is useful when using reverse proxies like Nginx or Cloudflare. |
| 118 | + /* |
| 119 | + * If your application is behind a reverse proxy (e.g., Nginx or Cloudflare), |
| 120 | + * enable this setting to fetch the real client IP from the proxy headers. |
113 | 121 | */ |
114 | 122 | 'use_reverse_proxy_ip' => false, |
115 | | - 'real_ip_header' => 'X-Forwarded-For' |
| 123 | + |
| 124 | + /* |
| 125 | + * The header used by reverse proxies to forward the real client IP. |
| 126 | + * Common values are 'X-Forwarded-For' or 'X-Real-IP'. |
| 127 | + */ |
| 128 | + 'real_ip_header' => 'X-Forwarded-For', |
116 | 129 | ], |
117 | 130 |
|
118 | 131 | /* |
119 | | - * Authentication monitoring configurations. |
| 132 | + * Configuration settings for authentication monitoring. |
120 | 133 | */ |
121 | 134 | 'authentication_monitoring' => [ |
122 | | - 'table' => 'authentications_monitoring', |
123 | | - |
124 | 135 | /* |
125 | | - * If you want to delete authentications-monitoring rows when the user is deleted from the users table you can set true or false. |
| 136 | + * If enabled, authentication records will be deleted when the associated user is deleted. |
126 | 137 | */ |
127 | 138 | 'delete_user_record_when_user_delete' => true, |
128 | 139 |
|
129 | 140 | /* |
130 | | - * You can set true/false for monitor login or logout. |
| 141 | + * Enable or disable monitoring of user login and logout events. |
| 142 | + * Set to true to track these actions, or false to disable. |
131 | 143 | */ |
132 | 144 | 'on_login' => true, |
133 | 145 | 'on_logout' => true, |
|
0 commit comments