lumen要想像laravel一样运行 php artisan serve 来启动本地运行服务可以添加以下Artisan命令
<?phpnamespace App\Console\Commands;use Illuminate\Console\Command;class Serve extends Command{/*** 命令名称及签名** @var string*/protected $signature = 'serve';/*** 命令描述** @var string*/protected $description = '本地 server 启动命令';/*** 创建命令** @return void*/public function __construct(){parent::__construct();}/*** 执行命令** @return mixed*/public function handle(){shell_exec("php -S localhost:8000 -t public");}}
