diff --git a/src/Illuminate/Foundation/Console/FindCommand.php b/src/Illuminate/Foundation/Console/FindCommand.php new file mode 100644 index 000000000000..729862ad46ab --- /dev/null +++ b/src/Illuminate/Foundation/Console/FindCommand.php @@ -0,0 +1,50 @@ +getApplication()->all())) + ->filter(fn (string $command) => $command !== $this->signature) + ->values(); + + $command = suggest( + 'Search for a command', + options: $commands->toArray(), + required: true, + hint: 'Type parts of a command name to search for' + ); + + $this->call($command); + + return 0; + } +} diff --git a/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php b/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php index 6ed57c76326e..2c5466a26f81 100755 --- a/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php +++ b/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php @@ -54,6 +54,7 @@ use Illuminate\Foundation\Console\EventListCommand; use Illuminate\Foundation\Console\EventMakeCommand; use Illuminate\Foundation\Console\ExceptionMakeCommand; +use Illuminate\Foundation\Console\FindCommand; use Illuminate\Foundation\Console\InterfaceMakeCommand; use Illuminate\Foundation\Console\JobMakeCommand; use Illuminate\Foundation\Console\KeyGenerateCommand; @@ -136,6 +137,7 @@ class ArtisanServiceProvider extends ServiceProvider implements DeferrableProvid 'EventCache' => EventCacheCommand::class, 'EventClear' => EventClearCommand::class, 'EventList' => EventListCommand::class, + 'Find' => FindCommand::class, 'InvokeSerializedClosure' => InvokeSerializedClosureCommand::class, 'KeyGenerate' => KeyGenerateCommand::class, 'Optimize' => OptimizeCommand::class,