Download the PHP package me-shaon/laravel-request-analytics without Composer
On this page you can find all versions of the php package me-shaon/laravel-request-analytics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download me-shaon/laravel-request-analytics
More information about me-shaon/laravel-request-analytics
Files in me-shaon/laravel-request-analytics
Package laravel-request-analytics
Short Description Simple request data analytics package for Laravel projects
License MIT
Homepage https://github.com/me-shaon/laravel-request-analytics
Informations about the package laravel-request-analytics
Laravel Request Analytics

Overview
Laravel Request Analytics is a comprehensive web analytics solution designed specifically for Laravel applications. It allows you to track traffic, understand your audience, and monitor performance through a clean dashboard, without sending data to third parties.
What You Get
- Instant dashboard: Real-time page views, visitors, bounce rate, and session duration
- Traffic & behavior insights: Clear view of user interactions, traffic patterns, and performance metrics
- Privacy-first: GDPR-friendly, IP anonymization, retention control, no third-party sharing
- Smart bot filtering: Automatically excludes crawlers, bots, and monitoring tools
- Geo & device insights: Location, browser, OS, and device breakdown with multiple provider support
- REST API access: Programmatic access to all analytics data for custom reporting and integrations
For full details, see the sections below.
Installation
Requirements
- PHP 8.1 or higher
- Laravel 10.0 or higher
- MySQL 5.7+ / PostgreSQL 10+ / SQLite 3.8+
Quick Installation (Recommended) ✨
Get up and running in just two commands:
This interactive installer will:
- Welcome you with helpful information about the package
- Automatically publish configuration files, assets, and views
- Publish and optionally run database migrations
- Optionally prompt you to star our GitHub repository
- Provide next steps and dashboard access information
After running the installer, your analytics dashboard will be ready at /analytics!
Manual Setup (Advanced)
For users who prefer manual control over the installation process or need custom configurations:
Database Setup
Publish and run the migrations:
Configuration
Publish the configuration file:
The configuration file will be published to config/request-analytics.php with the following options:
Publish Assets & Views
Publish dashboard assets:
Optionally, publish the views for customization:
Publishing Options
The package supports granular publishing of individual components:
Automated Data Pruning
The package includes automatic data cleanup to manage database size. Configure pruning in your scheduler:
Laravel 11+
Add to routes/console.php:
Or in bootstrap/app.php:
Laravel 10 and below
Add to app/Console/Kernel.php:
Key Features
Analytics & Reporting
- Real-time Dashboard: Interactive charts and metrics with responsive design
- Comprehensive Metrics: Page views, unique visitors, bounce rates, and session duration
- Traffic Analysis: Detailed breakdown of traffic sources and user pathways
- Performance Insights: Load times and user interaction patterns
Privacy & Compliance
- GDPR Compliance: Built-in privacy controls and data anonymization
- IP Anonymization: Configurable IP address masking for user privacy
- Data Retention: Configurable automatic data pruning and cleanup
Intelligence & Detection
- Advanced Bot Detection: Filters search engines, social bots, and crawlers
- IP Address Filtering: Skip tracking for specific IP addresses or CIDR blocks (e.g., internal IPs, admin IPs)
- Referrer Filtering: Exclude tracking for requests from specific referrer domains (e.g., spam sites, unwanted sources)
- Device Recognition: Browser, OS, and device type identification
- Geolocation Services: Multiple provider support (IP-API, IPGeolocation, MaxMind)
- Visitor Tracking: Cookie-based unique visitor identification
Performance & Integration
- High Performance: Optimized database queries with intelligent caching
- Queue Support: Background processing for high-traffic applications
- REST API: Complete programmatic access to analytics data
- Laravel Integration: Seamless integration with Laravel's authentication and middleware systems
Usage
Getting Started
After installation, the package automatically starts tracking requests based on your configuration. Here's what happens next:
- Dashboard Access: Visit
/analytics(or your configured pathname) to view the analytics dashboard - Automatic Tracking: Request data is captured automatically for web and API routes
Quick Commands
Configuration Options
Route Configuration
route.name: Named route identifier (default:request.analytics)route.pathname: URL path for dashboard access (default:analytics)
Data Capture Settings
capture.web: Track web requests (default:true)capture.api: Track API requests (default:true)capture.bots: Include bot traffic in analytics (default:false)
Queue Processing
queue.enabled: Process analytics data in background jobs for better performancequeue.on_queue: Specifies the queue name for processing analytics jobs
Path Filtering
ignore-paths: Array of paths to exclude from tracking (e.g., admin routes, health checks)
IP and Referrer Filtering
Filter out unwanted traffic to improve data quality and protect privacy by excluding specific IP addresses and referrer domains from analytics tracking.
skip_ips: Array of IP addresses or CIDR blocks to skip tracking. Supports exact IP matches (e.g.,'127.0.0.1') and CIDR notation for IP ranges (e.g.,'192.168.1.0/24'). Useful for excluding internal networks, admin IPs, or development environments.skip_referrers: Array of referrer domains to exclude from tracking. Filters out spam referrers, bot traffic, or internal tools (e.g.,'spam-site.com','internal-tool.com') to maintain clean analytics data.
Data Retention
pruning.enabled: Automatic data cleanup (default:true)pruning.days: Days to retain data (default: 90)
Geolocation Services
The package supports multiple geolocation providers:
IP-API (Default - Free)
- No API key required
- 45 requests per minute limit
- Includes country, region, city, timezone
IPGeolocation
- Requires API key from ipgeolocation.io
- Higher rate limits and accuracy
- Additional ISP and threat intelligence data
MaxMind
- Requires GeoIP2 database or web service account
- Highest accuracy and performance
- Enterprise-grade IP intelligence
Privacy & Compliance
- IP Anonymization: Masks the last octet of IPv4 addresses (192.168.1.xxx)
Bot Detection
Advanced bot detection includes:
- Search Engines: Google, Bing, Yahoo, DuckDuckGo, Baidu
- Social Media: Facebook, Twitter, LinkedIn, Pinterest crawlers
- SEO Tools: Ahrefs, SEMrush, Moz, Screaming Frog
- Monitoring: Pingdom, UptimeRobot, StatusCake
- Development: curl, wget, Postman, Insomnia
Dashboard Access & Usage
Dashboard Access
The analytics dashboard is available at /analytics by default. Access the dashboard through your configured route after authentication.
Access Control
Implement the CanAccessAnalyticsDashboard interface in your User model to control dashboard access:
Dashboard Features
- Real-time Metrics: Live visitor count, page views, and bounce rate
- Interactive Charts: Traffic trends, geographic distribution, device breakdown
- Top Pages: Most visited pages with performance metrics
- Visitor Insights: Browser, OS, and device analytics
- Traffic Sources: Referrer analysis and search engine traffic
- Performance Data: Page load times and user engagement metrics
API Documentation
The package provides a comprehensive REST API for programmatic access to analytics data.
Endpoints
GET /api/v1/analytics/overview
Retrieve comprehensive analytics overview with summary statistics and chart data.
Parameters:
date_range(optional): Number of days to look back (1-365, default: 30)start_date(optional): Start date (YYYY-MM-DD format)end_date(optional): End date (YYYY-MM-DD format, must be after start_date)with_percentages(optional): Include percentage data for applicable fields (true/false)
Response:
GET /api/v1/analytics/visitors
Get paginated visitor data with detailed information.
Parameters:
date_range(optional): Number of days to look back (1-365, default: 30)page(optional): Page number for pagination (default: 1)per_page(optional): Items per page, max 100 (default: 50)
Response:
GET /api/v1/analytics/page-views
Retrieve paginated page view data with performance metrics.
Parameters:
date_range(optional): Number of days to look back (1-365, default: 30)path(optional): Filter by specific path pattern (partial match)page(optional): Page number for pagination (default: 1)per_page(optional): Items per page, max 100 (default: 50)
Response:
Error Handling
API responses follow consistent error format:
Common HTTP Status Codes:
200: Success400: Bad Request (validation errors)401: Unauthorized (invalid or missing token)403: Forbidden (insufficient permissions)429: Too Many Requests (rate limited)500: Internal Server Error
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Ahmed shamim
- Omar Faruque
- Md Abul Hassan
- Al Nahian
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-request-analytics with dependencies
illuminate/contracts Version ^10.0 | ^11.0 | ^12.0 | ^13.0
spatie/laravel-package-tools Version ^1.16.0
