Download the PHP package laraditz/user-security without Composer
On this page you can find all versions of the php package laraditz/user-security. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package user-security
Laravel User Security
Add security pin, mnemonic key and 2fa authentication feature to users.
Installation
Via Composer
Configuration
The Laravel and Lumen configurations vary slightly, so here are the instructions for each of the frameworks.
Laravel
Edit the config/app.php file and add the following line to register the service provider:
Tip: If you're on Laravel version 5.5 or higher, you can skip this part of the setup in favour of the Auto-Discovery feature.
Lumen
Edit the bootstrap/app.php file and add the following line to register the service provider:
You will also need to enable Facades in bootstrap/app.php:
Open your user provider model class, for example App\Models\User, and add Laraditz\UserSecurity\Traits\UserSecurable trait:
Add a key to your .env file for hashing.
Add validation rule message to resources/lang/{lang_code}/validation.php.
Usage
Example usage as below snippet:
To use mnemonic functions, examples as below:
It also comes with mnemonic and mnemonic_exists rules:
- mnemonic - to check whether
mnemonic_wordsandmnemonic_entropymatch. - mnemonic_exists - to check whether
mnemonic_wordsormnemonic_entropyalready exists.
For security pin, you can use MatchSecurityPin rule. You can pass the model in the constructor. Otherwise, the rule will assume you want to use the session user. The model must use UserSecurable trait.
Change log
Please see the changelog for more information on what has changed recently.
Credits
License
MIT. Please see the license file for more information.
All versions of user-security with dependencies
illuminate/database Version ^8.0
furqansiddiqui/bip39-mnemonic-php Version dev-master
pragmarx/google2fa Version ^8.0
endroid/qr-code Version ^3.7