Download the PHP package ntimes/route-time-limits without Composer

On this page you can find all versions of the php package ntimes/route-time-limits. 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-time-limits

๐Ÿ•’ Laravel Route Time Limits

Latest Version on Packagist Total Downloads

A Laravel package that allows you to set time limits on routes and track usage times based on user authentication status. This package helps you monitor and control how much time is spent on specific routes over a defined period, with different limits for authenticated and guest users.


๐Ÿ“ฅ Installation

Install the package via composer:

Publish the configuration and migrations:

Run the migrations:


๐Ÿ“š Usage

๐Ÿ”ฐ Basic Usage

Add the middleware to your routes:

โš™๏ธ Configuration

You can customize the package behavior in the config/route_time_limits.php file:

๐Ÿ› ๏ธ Available Commands

๐Ÿงน Cleanup Old Records

The package includes a command to clean up old records:

This command is automatically scheduled to run daily, but you can also run it manually.

๐Ÿ”„ Reset Time Limits

For testing or administrative purposes, you can reset time limits:


๐Ÿ” How It Works

  1. When a user visits a route with the middleware applied, the package checks if there's an existing record for that route and user type (guest or authenticated).
  2. If no record exists, it creates one with the default time limit (or a custom one if configured).
  3. Each time the route is accessed, the time spent is tracked and added to the daily total.
  4. If the total time exceeds the configured limit, a 429 (Too Many Requests) response is returned.
  5. The time counter is reset daily.
  6. Different time limits are applied based on whether the user is authenticated or a guest.
  7. Guest users can be tracked by IP address if configured.

๐Ÿ“ƒ License

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


All versions of route-time-limits with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/database Version ^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/console Version ^8.0|^9.0|^10.0|^11.0|^12.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 ntimes/route-time-limits contains the following files

Loading the files please wait ....