11# Tatter\Visits  
22Lightweight traffic tracking for CodeIgniter 4
33
4- [ ![ ] ( https://github.com/tattersoftware/codeigniter4-visits/workflows/PHPUnit/badge.svg )] ( https://github.com/tattersoftware/codeigniter4-visits/actions?query=workflow%3A%22PHPUnit ) 
5- [ ![ ] ( https://github.com/tattersoftware/codeigniter4-visits/workflows/PHPStan/badge.svg )] ( https://github.com/tattersoftware/codeigniter4-visits/actions?query=workflow%3A%22PHPStan ) 
4+ [ ![ ] ( https://github.com/tattersoftware/codeigniter4-visits/workflows/PHPUnit/badge.svg )] ( https://github.com/tattersoftware/codeigniter4-visits/actions/workflows/phpunit.yml ) 
5+ [ ![ ] ( https://github.com/tattersoftware/codeigniter4-visits/workflows/PHPStan/badge.svg )] ( https://github.com/tattersoftware/codeigniter4-visits/actions/workflows/phpstan.yml ) 
6+ [ ![ ] ( https://github.com/tattersoftware/codeigniter4-visits/workflows/Deptrac/badge.svg )] ( https://github.com/tattersoftware/codeigniter4-visits/actions/workflows/deptrac.yml ) 
67[ ![ Coverage Status] ( https://coveralls.io/repos/github/tattersoftware/codeigniter4-visits/badge.svg?branch=develop )] ( https://coveralls.io/github/tattersoftware/codeigniter4-visits?branch=develop ) 
78
89## Quick Start  
@@ -19,28 +20,47 @@ Provides automated traffic tracking for CodeIgniter 4
1920
2021Install easily via Composer to take advantage of CodeIgniter 4's autoloading capabilities
2122and always be up-to-date:
22- *  ` > composer require tatter/visits ` 
23+ ``` shell 
24+ >  composer require tatter/visits
25+ ``` 
2326
2427Or, install manually by downloading the source files and adding the directory to
25- ` app/Config/Autoload.php ` .
28+ ** app/Config/Autoload.php** .
2629
2730Once the files are downloaded and included in the autoload, run any library migrations
2831to ensure the database is setup correctly:
29- *  ` > php spark migrate -all ` 
32+ ``` shell 
33+ >  php spark migrate --all
34+ ``` 
3035
3136## Configuration (optional)  
3237
3338The library's default behavior can be altered by extending its config file. Copy
3439** examples/Visits.php**  to ** app/Config/**  and follow the instructions in the
35- comments. If no config file is found in app/Config the library will use its own.
40+ comments. If no config file is found in ** app/Config/ **  the library will use its own.
3641
3742## Usage  
3843
3944If installed correctly CodeIgniter 4 will detect and autoload the class, service, and
4045config. The library includes an event listening for ` post_controller_constructor `  to
4146record page loads. If you prefer to handle them manually you may use the service to load
4247the class and record the current visit:
43- *  ` service('visits')->record(); ` 
48+ ``` php 
49+ service('visits')->record();
50+ ``` 
51+ 
52+ When manually tracking be sure to disable automated tracking in your Config file:
53+ ``` php 
54+ class Visits extends BaseConfig
55+ {
56+     /**
57+      * Whether to enable tracking in all controllers using
58+      * the post_controller_constructor event.
59+      */
60+     public bool $trackAllPages = true;
61+ ``` 
62+ 
63+ You may also limit which routes are tracked by adding them to the ` $excludeUris `  property.
4464
4565## Accessing data  
4666
0 commit comments