yzh52521 / webman-command
webman Framework, Laravel console artisan
v1.0.8
2023-08-14 01:05 UTC
Requires
- php: >=7.4
- illuminate/console: ^8.0|^9.0|^10.0
- illuminate/database: ^8.0|^9.0|^10.0
- illuminate/events: ^8.0|^9.0|^10.0
- symfony/console: ^5.3|^6.0
README
安装
composer require yzh52521/webman-command
插件依赖
workerman/webman-framework
illuminate/console
illuminate/database
illuminate/events
命令扫描
默认自动扫描 app\command 下的命令(同 webman/console 的逻辑)
配置命令
config/command.php
自定义命令
return [
\App\Commands\MyCommand::class,
];
#使用
新建命令
namespace app\command; use Illuminate\Console\Command; class Test extends Command { protected $signature = 'test'; protected $description = 'Test run command'; public function handle(): void { $this->info("test!"); } }
调用 和laravel 使用一样
php artisan test
业务中调用(比如控制器)
use \yzh52521\command\facade\Artisan; Artisan::call('test');