Download the PHP package codetyme/laravel-temp-password without Composer
On this page you can find all versions of the php package codetyme/laravel-temp-password. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codetyme/laravel-temp-password
More information about codetyme/laravel-temp-password
Files in codetyme/laravel-temp-password
Package laravel-temp-password
Short Description A Laravel package to generate temporary passwords
License MIT
Informations about the package laravel-temp-password
π Laravel Temp Password
A Laravel package to generate one-time, time-limited temporary passwords for user authentication. These passwords can be used in place of regular passwords during login and automatically expire after a configurable period (e.g., 5 minutes).
π Features
- No need to modify your existing login logic
- Supports default and custom user models
- Auto-expires passwords (default: 5 minutes)
- Optional CLI command to generate temporary passwords
- Supports password strength levels:
simple
,medium
,strong
- Uses Laravel's built-in authentication system
π¦ Installation
π Publish Config & Migrations
This will:
- Publish the
config/temp-password.php
file - Create the
temp_passwords
database table
βοΈ Configuration
Your published config file looks like this:
You can override these settings in your .env
file if needed:
π§ How It Works
Once installed, the package automatically hooks into Laravelβs default authentication.
No need to change Auth::attempt()
or override any guards.
You can log in with either:
- Regular user password
- A one-time, time-limited temporary password
π Usage
π Generate a Temp Password (Programmatically)
π₯οΈ Generate via Artisan Command (Optional)
Options:
Option | Description |
---|---|
--email |
User's email (required or prompted) |
--model |
Fully qualified model class (optional) |
--length |
Password length (optional) |
--strength |
Password strength (optional) |
Examples:
π§ Example Use in Tinker
π Database Table
The package creates a temp_passwords
table with the following structure:
Column | Description |
---|---|
authenticatable_id |
ID of the user |
authenticatable_type |
User model class (e.g. App\Models\User) |
temp_password |
Bcrypt-hashed temp password |
used |
Marked true after first use |
created_at |
For expiry check |
π‘οΈ Security Notes
- Passwords are hashed using
bcrypt
before storing - Temp passwords are one-time use only
- Expire automatically after the configured minutes
π Developer
Rohit Suthar, Mumbai Email: [email protected]
π License
MIT License β open-source and free to use.