Why has the artisan serve command been removed from Lumen 5.2?

后端 未结 5 1803
春和景丽
春和景丽 2021-02-01 06:08

Please. Does anybody know why Lumen\'s team removed the command php artisan serve? That command was very helpful !.

5条回答
  •  失恋的感觉
    2021-02-01 06:19

    I don't speak for Taylor, but my guess is that his reasoning is that a given microframework should not know - or care - about the server that's running it. A microframework should just assume that it's going to work, and leave it to the developer to figure out which tools are best to make that happen.

    Laravel is different, in that it offers a more "complete" - and highly opinionated - set of tools to get your web application off the ground. In a full-stack framework, it's not uncommon to provide at least a simple PHP server script.

    So with that in mind, it shouldn't be too hard to bootstrap Laravel's own server implementation and artisan commands into your Lumen app.

    If you really want to use the php artisan serve command rather than something a little more configurable like Vagrant, you can probably just copy Laravel's server.php into the root of your Lumen application, and then register Laravel's own Serve Command into Lumen.

    You'll probably have to change line 42 for your base path, but aside from that, it should be pretty easy to port over.

提交回复
热议问题