0
7
Login
Code
Issues
Pull requests
Events
Packages
b5db5338bbf5406f8392da5d2019df08f507e473
b5db5338bbf5406f8392da5d2019df08f507e473

closure-command

Latest Stable Version Total Downloads License

Installation

composer require friendsofhyperf/closure-command

Publish

php bin/hyperf.php vendor:publish friendsofhyperf/closure-command

Usage

// config/console.php

use FriendsOfHyperf\ClosureCommand\Console;
use FriendsOfHyperf\ClosureCommand\Inspiring;

use function FriendsOfHyperf\ClosureCommand\command;

Console::command('inspire', function () {
    $this->comment(Inspiring::quote());
})->describe('Display an inspiring quote');

Console::command('foo:bar', function() {
    $this->info('Command foo:bar executed.');
})->describe('Description of command foo::bar');

command('whoami', function () {
    $this->info('Your are friend of hyperf');
})->describe('Who am I');