Created
February 28, 2023 10:11
-
-
Save AnandPilania/025faaf37238fce0bc63b875901bae3d to your computer and use it in GitHub Desktop.
Generate Random Password with Laravel Console Route
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ... ADD TO `web/console.php` | |
| Artisan::command('pswd {length?}', function ($length = 24) { | |
| dd(implode('', array_map(function () { | |
| return chr(random_int(33, 126)); | |
| }, array_fill(0, $length, null)))); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment