Download the PHP package joe-nassar-tech/laravel-exponential-lockout without Composer

On this page you can find all versions of the php package joe-nassar-tech/laravel-exponential-lockout. 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-exponential-lockout

Laravel Exponential Lockout

A comprehensive Laravel package for implementing exponential lockout functionality on failed authentication attempts with configurable contexts and response handling.

Features

Installation

Install via Composer:

Publish the configuration file:

Configuration

The package comes with sensible defaults, but you can customize everything in config/exponential-lockout.php:

How It Works

🎯 Perfect Exponential Lockout Behavior

The package implements a grace attempt system that provides exactly 1 attempt after each lockout period:

Attempt Result Behavior
1st-3rd ❌ ✅ Free attempts No lockout (configurable with min_attempts)
4th ❌ 🚫 Block 60s First lockout (using default delays)
After 60s 🎁 1 grace attempt Exactly 1 try allowed
Grace ❌ 🚫 Block 300s Second lockout (5 minutes)
After 300s 🎁 1 grace attempt Exactly 1 try allowed
Grace ❌ 🚫 Block 900s Third lockout (15 minutes)
Any Success ✅ 🔄 Complete Reset Back to 3 free attempts

🔑 Key Features:

Basic Usage

1. Middleware Protection

Protect routes with middleware:

2. Manual Lockout Management

Use the Lockout facade for manual control:

3. OTP Verification Example

Advanced Usage

Custom Key Extraction

Define custom key extractors in the config:

Custom Response Handling

Implement custom response logic:

Check Lockout Status

Check if a user is locked out before processing:

Get Detailed Lockout Information

Blade Directives

Use Blade directives in your templates:

Artisan Commands

Clear Specific Lockout

Clear All Lockouts for Context

API Reference

Lockout Facade Methods

Context Configuration

Each context can be configured independently or inherit from templates:

Using Templates (Recommended)

Direct Configuration

Available Key Extractors

Response Modes

Delay Sequences

Default sequence provides exponential backoff:

Customize per context:

Error Handling

The package includes comprehensive error handling:

Cache Considerations

Cache Store Selection

Configure the cache store in your config:

TTL Management

Cache entries automatically expire after lockout duration + 1 hour buffer.

Redis Optimization

For Redis, consider using a dedicated database:

Testing

The package includes comprehensive test coverage. Run tests with:

Testing Lockouts in Your App

Performance Considerations

Security Best Practices

  1. Rate Limiting: Combine with Laravel's rate limiting for comprehensive protection
  2. IP Tracking: Use IP-based lockouts for anonymous endpoints
  3. Context Separation: Use different contexts for different authentication methods
  4. Cache Security: Secure your cache store (Redis AUTH, etc.)
  5. Key Hashing: Keys are automatically hashed for privacy

Troubleshooting

Common Issues

Lockouts not working:

Lockouts not clearing:

Wrong response format:

Debug Mode

Enable debug logging:

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

License

This package is open-sourced software licensed under the MIT license.

Changelog

See CHANGELOG.md for version history and updates.

Support


About the Developer

Joe Nassar
Email: [email protected]

Made with ❤️ for the Laravel community


All versions of laravel-exponential-lockout with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/cache Version ^9.0|^10.0|^11.0|^12.0
illuminate/console Version ^9.0|^10.0|^11.0|^12.0
illuminate/http Version ^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 joe-nassar-tech/laravel-exponential-lockout contains the following files

Loading the files please wait ...