Download the PHP package fbpkg/laravel-creds without Composer
On this page you can find all versions of the php package fbpkg/laravel-creds. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fbpkg/laravel-creds
More information about fbpkg/laravel-creds
Files in fbpkg/laravel-creds
Package laravel-creds
Short Description Authentication credentials and OTP utilities for Laravel.
License MIT
Informations about the package laravel-creds
Laravel Cred
Authentication credentials and OTP utilities for Laravel.
Requirements
- PHP 8.2+
- Laravel 11+
fbpkg/laravel-supportfbpkg/laravel-sms
Installation
Install the package via Composer:
The package service provider is automatically registered through Laravel package discovery.
Configuration
Publish the package configuration:
The configuration file will be published to:
You can customize:
- OTP expiration
- OTP resend interval
- OTP maximum attempts
- OTP block duration
- OTP channels and code formats
- Password history
- Password reuse prevention
- Cleanup settings
- Database table names
Database
Publish the package migrations:
Then run the migrations:
The package uses two tables:
otp_codes— Stores OTP codes and their verification state.passwords— Stores password history for authenticatable models.
Both table names can be customized through config/cred.php.
SMS Configuration
If you use the sms OTP channel, you must configure the SMS gateway through fbpkg/laravel-sms.
Make sure the required SMS panel credentials and settings are configured according to the SMS package.
You must also configure the OTP SMS pattern ID in your application's .env:
The pattern configuration is available in config/cred.php:
The configured pattern must contain the variable name configured by variable so the generated OTP code can be sent correctly.
For example, with the default configuration, the SMS pattern should accept:
SMS Package Configuration
The SMS gateway itself is configured by fbpkg/laravel-sms.
For example, when using the default ippanel gateway, configure the required environment variables for that package before sending OTPs.
Refer to the fbpkg/laravel-sms documentation for the complete SMS gateway configuration.
OTP
OtpService handles OTP generation, delivery and verification.
Example:
Verify the submitted code:
The result is returned as an array containing the operation status and related information:
Possible verification statuses include:
verifiednot_foundusedexpiredinvalidblocked
Passwords
Add the HasPassword trait to your authenticatable model:
Set a password:
The result is returned as an array:
If the password cannot be reused according to the configured password history:
Check the current password:
This returns a boolean.
Password History
The package keeps password history and can prevent users from reusing recent passwords.
Configure these options in config/cred.php:
history_limitdetermines how many password records are retained.prevent_reusedetermines how many previous passwords are checked before allowing a new password.
Cleanup
Automatic cleanup is enabled by default:
Cleanup removes old OTP records and other eligible package records during package operations.
Durations can be written using:
s— secondsm— minutesh— hoursd— days
For example:
License
The MIT License. See the LICENSE file for details.
All versions of laravel-creds with dependencies
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
fbpkg/laravel-support Version ^0.3.0
fbpkg/laravel-sms Version ^0.1.2