2.1.0
This package introduces a streamlined way to manage user account and password expiration in Laravel applications.
Features
- Account Expiry Middleware: Automatically check if a user's account has expired and handle it accordingly.
- Password Expiry Middleware: Enforce password expiration policies seamlessly.
- Event-Driven Architecture: Leverage preconfigured events and listeners for handling expiry-related actions.
- Events:
ExpiredAccount
: Triggered when a user’s account expires.ExpiredPassword
: Triggered when a user’s password expires.
- Listeners:
LogoutOnExpired
: Logs out the user upon account or password expiry.
- Events:
- Configuration File: Fully customisable event-to-listener mappings via
config/laravel-expiry.php
. - Migrations: Add
account_expired_at
andpassword_expired_at
columns to theusers
table for expiry tracking. - Automatic Middleware Registration: Middleware aliases (
account.expiry
andpassword.expiry
) are registered automatically for ease of use.
Installation
- Install via Composer.
- Publish and run migrations.
- Middleware is automatically registered.
Usage
- Add expiry checks to your routes with the provided middleware.
- Customise event listeners through the configuration file.
- Extend and adapt the package for your application needs.
Testing
- Fully tested with PestPHP to ensure reliability and maintainability.
- Run tests using:
vendor/bin/pest --testdox
Full Changelog: 2.0.2...2.1.0