mijatovicmilan / laravel-password-generator
Create a secure password.
1.0.0
2022-03-11 15:00 UTC
Requires
- php: ^8.0
- illuminate/contracts: ^9.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- nunomaduro/collision: ^6.0
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
README
Installation
You can install the package via composer:
composer require mijatovicmilan/laravel-password-generator
You can publish the config file with:
php artisan vendor:publish --tag="password-generator-config"
This is the contents of the published config file:
return [ // Minimum password length "minimum_password_length" => 6, // If password length is not passed we will use this length instead "default_password_length" => 6, // If password strength is not passed we will use this strength instead "default_password_strength" => 2, ];
Usage
GeneratePassword action accept 2 parameters, both parameters are optinal. First parameter is password length, if left empty we will use length defined in config. Second parameter is password strength, if left empty we will use strength defined in config file.
use MijatovicMilan\LaravelPasswordGenerator\Actions\GeneratePassword; $password = (new GeneratePassword)(12, 2);
or
use MijatovicMilan\LaravelPasswordGenerator\Actions\GeneratePassword; public function something(GeneratePassword $generatePassword) { $password = $generatePassword(); }
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.