Download the PHP package nmehroj/route-usage-tracker without Composer

On this page you can find all versions of the php package nmehroj/route-usage-tracker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package route-usage-tracker

Laravel Route Usage Tracker

Latest Version Laravel Vue.js Inertia.js

A Laravel package for automatically tracking and analyzing route usage statistics with a beautiful Vue.js 3 dashboard and Inertia.js support.

🚨 Beta Release Notice: Version 2.0.0-beta introduces major new features including Vue.js 3 dashboard and Inertia.js support. While stable for testing, please use with caution in production environments.

Description

This package allows you to track how routes are being used in your Laravel applications. It automatically records how many times each route has been accessed, when it was first and last used, and provides comprehensive statistics for performance analysis.

Features

🎯 Core Tracking Features

🎨 Dashboard Features (Beta)

  1. Build assets:

  2. Visit your dashboard (automatically available):

📝 Note: The dashboard route /route-usage-dashboard is automatically registered by the package. No need to manually add routes!

Quick Start Example

Usage

Middleware Registration (Optional)

The package automatically registers a global middleware, but you can also manually control it by adding it to specific route groups in app/Http/Kernel.php:

Automatic Route Tracking

All routes are automatically tracked out of the box. For each route request, the following information is stored:

Viewing Statistics

Via Artisan Command

Via Code

Using the Model Directly
Using the Facade (Recommended)

Dashboard with Inertia.js & Vue.js

The package includes a modern, reactive Vue.js 3 dashboard built with Inertia.js for visualizing route usage statistics, similar to Laravel Nightwatch.

Inertia.js Dashboard Installation

🚀 One-Command Setup (Recommended)

This single command will:

Available Options:

Manual Installation (Alternative)

  1. Ensure Inertia.js is set up in your Laravel application:

Follow the Inertia.js Laravel installation guide if not already installed.

  1. Publish dashboard assets:

  2. Install required dependencies:

  3. Update your resources/js/app.js for Inertia.js:

  4. Update your vite.config.js:

  5. Build assets:

🎉 Automatic Route Registration: The dashboard route /route-usage-dashboard is automatically registered by the package. No manual route configuration needed!

Dashboard Features

Dashboard Usage

  1. Visit the dashboard:

  2. Available dashboard endpoints:

    • /route-usage-tracker/dashboard - Main dashboard view
    • /route-usage-tracker/api/summary - Statistics summary
    • /route-usage-tracker/api/routes - Routes with filtering
    • /route-usage-tracker/api/daily-usage - Daily usage charts
    • /route-usage-tracker/api/type-stats - Route type statistics
    • /route-usage-tracker/api/top-routes - Most used routes
    • /route-usage-tracker/api/recent-activity - Recent route activity
    • /route-usage-tracker/api/export - Export data as CSV
  3. Dashboard API parameters:

Database Structure

The route_usage table has the following columns:

Column Type Description
id bigint Primary key
route_name varchar(255) Route name
route_path varchar(500) URL path
method varchar(10) HTTP method
route_type varchar(50) Route type (web, api, admin, dashboard, auth, assets)
usage_count bigint Usage count
first_used_at timestamp First usage timestamp
last_used_at timestamp Last usage timestamp
created_at timestamp Created timestamp
updated_at timestamp Updated timestamp

Configuration

Customizing Tracked Routes

The package automatically ignores common development and debugging routes. To customize which routes are tracked:

Publish the config file first:

Then edit config/route-usage-tracker.php to add ignored routes:

Practical Examples

1. Dashboard Analytics

2. Weekly Usage Report

3. API Usage Analytics

Advanced Configuration

Publishing Configuration

To customize the package behavior, publish the configuration file:

Then edit config/route-usage-tracker.php:

Environment Variables

You can add these variables to your .env file:

Requirements

Testing

To test the package:

Performance Considerations

Troubleshooting

Routes Not Being Tracked

  1. Ensure the package is properly installed: composer show nmehroj/route-usage-tracker
  2. Check if middleware is registered: php artisan route:list --middleware
  3. Verify database migration ran: Check for route_usage table
  4. Check configuration: config('route-usage-tracker.enabled')

Performance Issues

  1. Enable auto-cleanup to remove old data
  2. Add database indexes if tracking high-volume routes
  3. Consider excluding non-essential routes via configuration

Contributing

We welcome contributions! To contribute:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Author

Nmehroj - GitHub


Made with ❤️ for the Laravel community


All versions of route-usage-tracker with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
illuminate/support Version ^10.0|^11.0
illuminate/console Version ^10.0|^11.0
illuminate/database Version ^10.0|^11.0
illuminate/http Version ^10.0|^11.0
illuminate/contracts Version ^10.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nmehroj/route-usage-tracker contains the following files

Loading the files please wait ...