Skip to content

Instantly share code, notes, and snippets.

@AnandPilania
Created February 28, 2023 10:11
Show Gist options
  • Select an option

  • Save AnandPilania/025faaf37238fce0bc63b875901bae3d to your computer and use it in GitHub Desktop.

Select an option

Save AnandPilania/025faaf37238fce0bc63b875901bae3d to your computer and use it in GitHub Desktop.
Generate Random Password with Laravel Console Route
// ... 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