Download the PHP package bilfeldt/laravel-route-statistics without Composer

On this page you can find all versions of the php package bilfeldt/laravel-route-statistics. 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 laravel-route-statistics

Log Laravel route usage statistics

Latest Version on Packagist GitHub Tests Action Status StyleCI Code Style Status Total Downloads

Log Laravel requests and responses for statistical purposes and optionally aggregate by hours/days/months for minimal db requirements.

Version Laravel PHP
1.* 8. | 9. 7.4. | 8.0. | 8.1.*
2.* 10.* 8.1. | 8.2.
3.* 11.* 8.1. | 8.2. | 8.3.*
4.* 11.* 8.2. | 8.3. | 8.4.*

Description

Log requests and group them together for aggregated statistics of route usage. Grouping requests by route means that this package saves a minimum of data to the database and subsequent purging of old data can improve this even further.

This package lets you:

Installation

You can install the package via composer:

You can publish and run the migrations with:

You can publish the config file with:

Usage

There are a few ways to enable logging of route usage:

Enable global logging

This will enable site-wide logging and although being the easiest implementation this might not be exactly what you are looking for (consider only logging relevant routes using the middleware approach below)

Simply add RouteStatisticsMiddleware as a global middleware in app/Http/Kernel.php

Enable via middleware

Instead of adding RouteStatisticsMiddleware as a global middleware then it can be added to certain routes or route groups using:

Enable using request macro

It is possible to enable logging ad-hoc, usually within a controller, which is useful for any conditional logging:

Artisan commands

This package comes with two neat Artisan commands:

How it works

This package works as follows:

  1. Tag the request for logging: Can be done using middleware or request helper
  2. (optional) Add any context data which will be used when logging: A common use case is adding relevant route parameters like a team_id for example
  3. Log the request: Persist the log record to the database - the following will be logged when using the default logger:
    • user_id: The authenticated user (if any)
    • team_id: The team id associated with the request (if available)
    • method: The HTTP method (GET/POST/...)
    • route: The route name (if available) or the route URI (eg /posts/{post})
    • parameters: The route parameters passed (if enabled else null)
    • status: The HTTP status (eg 202)
    • ip: The request ip
    • date: The date of the request as datetime (can be aggregated)
    • counter: Number of requests logged when aggregating records by minute/hour/day/month...

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

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-route-statistics with dependencies

PHP Build Version
Package Version
Requires php Version ~8.2.0 || ~8.3.0 || ~8.4.0
bilfeldt/laravel-request-logger Version ^3.0
illuminate/contracts Version ^11.0
laravel/framework Version ^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 bilfeldt/laravel-route-statistics contains the following files

Loading the files please wait ....