Skip to content

2.1.0

Compare
Choose a tag to compare
@nasrulhazim nasrulhazim released this 02 Dec 09:07
· 5 commits to master since this release

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.
  • Configuration File: Fully customisable event-to-listener mappings via config/laravel-expiry.php.
  • Migrations: Add account_expired_at and password_expired_at columns to the users table for expiry tracking.
  • Automatic Middleware Registration: Middleware aliases (account.expiry and password.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