Laravel Zero For Command App

If you only need an application for command only, found this
https://laravel-zero.com/ to make only commands app

composer create-project --prefer-dist laravel-zero/laravel-zero movie-cli

Creating menu app

php make:command MenuCommand

class MenuCommand extends Command
{
    /**
     * Execute the console command.
     *
     * @return void
     */
    public function handle()
    {
        $option = $this->menu('Pizza menu', [
            'Freshly baked muffins',
            'Freshly baked croissants',
            'Turnovers, crumb cake, cinnamon buns, scones',
        ])->open();

        $this->info("You have chosen the option number #$option");
    }
}

installing without laravel zero

composer require nunomaduro/laravel-console-menu

Subscribe to You Live What You Learn

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
[email protected]
Subscribe