x-blade / x-blade-visitor-tracker
A simple Laravel package to track website visitors and store them in a JSON file.
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Blade
pkg:composer/x-blade/x-blade-visitor-tracker
Requires
- php: >=8.0
- illuminate/support: ^9.0|^10.0|^11.0|^12.0
Suggests
- geoip2/geoip2: Required if you want to track visitor locations
README
XBlade Visitor Tracker is a simple Laravel package that logs website visitors and stores their information in a JSON file.
Features
- Logs visitor IP, User-Agent, and visit time
- Stores logs in a JSON file
- Provides a simple Blade view to display logs
- Configurable via
config/visitor-tracker.php - Excludes specific IPs from logging
Installation
You can install the package via Composer:
composer require x-blade/x-blade-visitor-tracker
Publish Configuration File
After installation, publish the configuration file:
php artisan vendor:publish --tag=visitor-tracker-config
This will create a config/visitor-tracker.php file where you can modify settings.
Publish Views
To publish the visitor log view:
php artisan vendor:publish --tag=visitor-tracker-views --force
View Visitor Logs
You can view visitor logs by using short tag html:
<x-blade-visitor-tracker-views />
This will display a simple table with all visitor entries.
Configuration
Modify config/visitor-tracker.php as needed:
return [ 'storage_path' => storage_path('app/visitor.json'), 'enabled' => true, 'excluded_ips' => [ '127.0.0.1', ], ];
storage_path: Defines where the JSON log file is stored.enabled: Enables or disables visitor logging.excluded_ips: IP addresses to exclude from tracking.
License
This package is open-source and licensed under the MIT License.
For more details, visit x-blade.dev. 🚀