Download the PHP package cleaniquecoders/laravel-expiry without Composer
On this page you can find all versions of the php package cleaniquecoders/laravel-expiry. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-expiry
Laravel Expiry
cleaniquecoders/laravel-expiry
is a Laravel package that enables expiration for user accounts and passwords with seamless middleware and event-driven support.
Features
- Account Expiry: Middleware to check and handle expired accounts.
- Password Expiry: Middleware to enforce password expiration policies.
- Event Listeners: Automatically trigger events when accounts or passwords expire.
Installation
Install the package via Composer:
Publish and run the migration files to add the necessary expiry columns:
Middleware Registration
The package automatically registers the following middleware in your application:
account.expiry
: Handles account expiry checks.password.expiry
: Handles password expiry checks.
Usage
Apply Middleware
Use the middleware in your routes to enforce expiry checks:
Event Listeners
The package provides a configuration-driven approach to managing event listeners. By default, the following events and listeners are configured:
Default Event-to-Listener Mapping
The configuration (config/laravel-expiry.php
) includes the following mappings:
Handling Events
The package automatically registers these events and listeners. You can modify or extend the behaviour by updating the configuration file.
For example, when a user's account or password expires:
- The
ExpiredAccount
orExpiredPassword
event is triggered. - The
LogoutOnExpired
listener handles these events by logging the user out.
Customising Listeners
To add custom listeners for these events, update the configuration file (config/laravel-expiry.php
):
With this setup, the package makes it easy to integrate custom logic for handling expiry events.
Testing
To run the test suite, use the following command:
The package is fully tested with PestPHP to ensure reliability.
Contributing
Thank you for considering contributing to cleaniquecoders/laravel-expiry
. Contributions are welcome and appreciated!
Reporting Bugs
If you find a bug, you can either:
- Submit a pull request with a failing test case.
- Create an issue describing the problem clearly with steps to reproduce it.
Coding Style
The package follows PSR-2 coding standards and PSR-4 autoloading.
License
This package is open-source software licensed under the MIT license.
All versions of laravel-expiry with dependencies
doctrine/dbal Version ^3.0
illuminate/auth Version ^9.0 | ^10.0 | ^11.0
illuminate/support Version ^9.0 | ^10.0 | ^11.0
spatie/laravel-package-tools Version ^1.16