prompts icon indicating copy to clipboard operation
prompts copied to clipboard

Fallback on SearchPrompt don't show options

Open schonhoff opened this issue 8 months ago • 0 comments

Laravel Prompts Version

0.3.5

Laravel Version

11.44.2

PHP Version

8.3.17

Operating System & Version

Windows 11 (not WSL, using Herd)

Terminal Application

Powershell 7 with PHPStorm

Description

Hello,

the command for publishing flux components php artisan flux:publish don't show the options. I would expect it would work like the php artisan vendor:publish command which shows the possible choices.

vendor:publish output example:

 Which provider or tag's files would you like to publish?
  All providers and tags ....................................................................................... 0  
  Provider: Appstract\Opcache\OpcacheServiceProvider ........................................................... 1  
  Provider: Barryvdh\Debugbar\ServiceProvider .................................................................. 2  
  Provider: Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider ................................................. 3  
  Provider: BladeUIKit\BladeUIKitServiceProvider ............................................................... 4  
  Provider: BladeUI\Icons\BladeIconsServiceProvider ............................................................ 5  
  Provider: Illuminate\Foundation\Providers\FoundationServiceProvider .......................................... 6  
  Provider: Illuminate\Mail\MailServiceProvider ................................................................ 7  
  Provider: Illuminate\Notifications\NotificationServiceProvider ............................................... 8  
  Provider: Illuminate\Pagination\PaginationServiceProvider .................................................... 9  

flux:publish:

php artisan flux:publish

  Which component would you like to publish?
❯ 

If you try a component, which isn't provided in the list mentioned from joshhanley in the github issue below, it throws a LogicException:

php artisan flux:publish

  Which component would you like to publish?
❯ navlist


   LogicException 

  Choice question must have at least 1 choice available.

  at vendor\symfony\console\Question\ChoiceQuestion.php:38
     34▕         private array $choices,
     35▕         string|bool|int|float|null $default = null,
     36▕     ) {
     37▕         if (!$choices) {
  ➜  38▕             throw new \LogicException('Choice question must have at least 1 choice available.');
     39▕         }
     40▕ 
     41▕         parent::__construct($question, $default);
     42▕

  1   vendor\laravel\framework\src\Illuminate\Console\View\Components\Choice.php:40
      Symfony\Component\Console\Question\ChoiceQuestion::__construct("Which component would you like to publish?", [])

  2   vendor\laravel\framework\src\Illuminate\Console\View\Components\Choice.php:23
      Illuminate\Console\View\Components\Choice::getChoiceQuestion("Which component would you like to publish?", [])

Without choices it is very difficult to use the command.

Steps To Reproduce

Details can be found on the flux issue https://github.com/livewire/flux/issues/1312

schonhoff avatar Mar 28 '25 07:03 schonhoff