๐ A package to execute a random artisan command
Aren't you tired of having to think about which artisan command to execute? The spatie/laravel-random-command package takes that pain away. It provides a random
command that will pick a random command and execute it.
This is how you can unleash the power of the random command. Just execute it and don't look back!
php artisan random
Let's take a look at how such greatness is achieved. Here's the code of the RandomCommand
.
public function handle()
{
$this->confirm('You are about to execute a random command. Are you sure you want to do this?');
$allCommands = $this->getApplication()->all();
$commandString = collect($allCommands)->keys()->random();
$this->info("Executing command: `{$commandString}`");
// ๐งจ๐งจ๐งจ
Artisan::call($commandString, [], $this->output);
}
We don't recommend installing this in your production environment. Or your local environment. In fact it might be best not to install it at all.
What are your thoughts on "๐ A package to execute a random artisan command"?