friendsofhyperf/closure-command

Closure Command For Hyperf

1.1.1 2021-07-27 08:34 UTC

This package is auto-updated.

Last update: 2021-12-02 07:27:47 UTC


README

Open in Visual Studio Code Latest Stable Version Total Downloads GitHub 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');