Download the PHP package monishroy/visitor-tracking without Composer
On this page you can find all versions of the php package monishroy/visitor-tracking. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download monishroy/visitor-tracking
More information about monishroy/visitor-tracking
Files in monishroy/visitor-tracking
Package visitor-tracking
Short Description A Laravel package for tracking website visitors
License MIT
Homepage https://github.com/monishroy/visitor-tracking
Informations about the package visitor-tracking
Visitor Tracking Package for Laravel
The monishroy/visitor-tracking
package provides a simple way to track and analyze visitor data in your Laravel application, including total visitors, unique visitors, top visited pages, countries, operating systems, and devices.
Installation
-
Install the Package
Require the package via Composer:
-
Run Database Migrations
After installing the package, run the migrations to set up the necessary database tables:
Middleware
The package includes a middleware aliased as visitor_tracking
to track visitor data for specific routes. To use it, apply the middleware to your routes.
Applying the Middleware
You can apply the visitor_tracking
middleware to individual routes or route groups in your web.php
or api.php
files.
Example: Single Route
Example: Route Group
The middleware will automatically track visitor data for the routes it is applied to.
Usage
The package provides a Visitor
facade to access visitor tracking data. You can use the following methods to retrieve analytics:
Example Output
Running the above code will dump the visitor data, which might look like this (example):
Customization
Using the VisitorTable Model
The package includes a VisitorTable
model that you can use to interact directly with the visitor tracking database table. This allows you to perform custom queries or extend the functionality.
Example: Querying Visitor Data
You can also extend the VisitorTable
model to add custom methods or relationships.
Requirements
- PHP >= 7.4
- Laravel >= 8.0
License
This package is open-sourced software licensed under the MIT license.
Support
For issues or feature requests, please open an issue on the GitHub repository.
All versions of visitor-tracking with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0