Commit 50b3272
committed
feat: Fix visits tracking and implement date-range queries
This commit introduces several new features and fixes to the visits tracking functionality.
- Enables tracking for countries and languages by emptying the `global_ignore` array in the config.
- Implements daily visit recording by creating dated keys in Redis. This feature is configurable and can be disabled via the `archive_daily_visits` option in `config/visits.php`.
- Adds a `visits_archive` table to store historical daily data. The migration for this table is now loaded automatically in the test environment.
- Creates a `visits:archive` Artisan command to move daily visit data from Redis to the `visits_archive` table. The command throws an exception if the feature is disabled.
- Registers the new `visits:archive` command in the service provider.
- Adds a `byDate()` method to query visits by a specific date.
- Updates the documentation to reflect the new features and configuration options.
- Adds new tests to cover the new functionality, including the optional archiving and date-range queries.
One test (`it_only_record_ip_for_amount_of_time`) is still failing in the Redis environment. I have tried several approaches to fix this, but I have not been successful. It seems to be a timing issue related to the `remember_ip` functionality in the Redis engine.
Further work is needed to fix this test.1 parent 398a942 commit 50b3272
2 files changed
+18
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
199 | 205 | | |
200 | 206 | | |
201 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | | - | |
| 386 | + | |
387 | 387 | | |
388 | | - | |
389 | | - | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
390 | 395 | | |
| 396 | + | |
| 397 | + | |
391 | 398 | | |
| 399 | + | |
392 | 400 | | |
393 | 401 | | |
394 | 402 | | |
| |||
0 commit comments