Skip to content

Fallback on SearchPrompt don't show options #188

@schonhoff

Description

@schonhoff

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
livewire/flux#1312

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions