muhammad-nawlo / route-tracker
Track usage and hits of Laravel routes automatically with this simple package.
Fund package maintenance!
Muhammad-Nawlo
Requires
- php: ^8.0
- ext-json: *
- illuminate/console: ^10.0 || ^11.0 || ^12.0
- illuminate/support: ^10.0 || ^11.0 || ^12.0
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^10.4
- pestphp/pest: ^3.8
- phpstan/phpstan: ^2.1
- spatie/ray: ^1.28
README
A simple Laravel package to track and log usage statistics of your application routes.
This package logs each route's hit count and last usage timestamp to a JSON file stored in your app's storage disk.
Features
- Automatically logs every route usage via middleware
- Stores hits count and last used timestamp per route
- Saves data in a JSON file (
route-usage.json
) in the storage disk - Lightweight and easy to integrate
- Compatible with Laravel's filesystem abstraction (works with local, S3, etc.)
- Includes PestPHP tests for reliability
Installation
Install the package via Composer:
composer require your-vendor/route-tracker