open-southeners/laravel-console-file-menu

Laravel Console Menu for files and directories

1.0.0 2024-03-18 01:35 UTC

This package is auto-updated.

Last update: 2024-04-18 01:47:16 UTC


README

Like NunoMaduro's console menu package but for files.

screenshot

Getting started

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

Partners

skore logo

License

This package is open-sourced software licensed under the MIT license.