Skip to content

Commit 97d9ffa

Browse files
Fix: Enable country tracking by default
The default configuration disabled country tracking by setting 'country' in the `global_ignore` array. This was surprising to users and led to confusion when the `countries()` method returned an empty array. This change removes 'country' from the `global_ignore` array in the default configuration, enabling country tracking by default. Additionally, this change adds a new "Configuration" section to the `README.md` to explain the `global_ignore` option and how to use it.
1 parent ff9e034 commit 97d9ffa

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,26 @@ composer require awssat/laravel-visits
3232
- [Visits lists](docs/7_visits-lists.md)
3333
- [Clear and reset values](docs/8_clear-and-reset-values.md)
3434

35+
## Configuration
36+
37+
You can publish the configuration file using the following command:
38+
39+
```bash
40+
php artisan vendor:publish --provider="Awssat\Visits\VisitsServiceProvider" --tag="config"
41+
```
42+
43+
This will create a `config/visits.php` file in your application. In this file, you can configure the behavior of the package.
44+
45+
### `global_ignore`
46+
47+
The `global_ignore` option allows you to prevent the recording of certain types of data. By default, no data is ignored. You can choose to ignore any of the following: `'country'`, `'refer'`, `'periods'`, `'operatingSystem'`, `'language'`.
48+
49+
For example, to ignore country and language tracking, you would set the option like this:
50+
51+
```php
52+
'global_ignore' => ['country', 'language'],
53+
```
54+
3555
## Changelog
3656

3757
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

src/config/visits.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
| stop recording specific items (can be any of these: 'country', 'refer', 'periods', 'operatingSystem', 'language')
7373
|
7474
*/
75-
'global_ignore' => ['country'],
75+
'global_ignore' => [],
7676

7777
];
7878

0 commit comments

Comments
 (0)