Like NunoMaduro's console menu package but for files.
composer require open-southeners/laravel-console-file-menu
Start using it by copying code from below:
use NunoMaduro\LaravelConsoleMenu\Menu;
// In between your command's code:
$result = $this->fileMenu('/base/path')
// Customise the underlying menu here: https://github.com/php-school/cli-menu?tab=readme-ov-file#appearance
->customise(fn (Menu $menu) => $menu->setForegroundColour('green')
->setBackgroundColour('black')
)
->onlyDirectories(false)
->hideFileExtensions(false)
->respectIgnored(true)
->open();
// $result will contain the full file/directory selected path or null otherwise
This package is open-sourced software licensed under the MIT license.