PhpStorm 启动任务 - php artisan serve

PhpStorm Startup task - php artisan serve

我正在本地处理项目,每次启动项目时我都想运行"php artisan serve"使用 PhpStorm 的启动任务功能。

我转到设置 -> 工具 -> 启动任务 并单击绿色加号,然后添加新配置。但是,我不知道从那里选择什么。那里没有 "artisan" 选项。

我应该怎么做?

Artisan 是一个 php 脚本,因此您可以简单地添加一个新的 PHP 脚本 任务:

文件:浏览到您的项目目录和 select artisan.

参数:服务

如果您的 php 解释器在 PHPStorm 设置中设置正确,那么您将能够 运行 此任务,并且它会在启动时自动 运行。

Where do I add this PHP task? – Brad

phpstorm > 2020.3

  • 文件:

path/to/artisan

通常位于 Laravel 项目的根目录。

  • 参数:

serve

PHP 的旧版本 | phpstorm 2017.2 <

File -> Settings... -> Tools -> Startup Tasks -> +(Add) -> PHP Script

姓名:发球

仅限单个实例 - 选中