> ## Documentation Index
> Fetch the complete documentation index at: https://kawax.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# Laravel Boost Custom Agent for PhpStorm with GitHub Copilot

> 面向 PhpStorm 的 GitHub Copilot 外掛，為 Laravel Boost 增加自定義 agent 的包。支援 macOS/Windows/Linux/WSL。

## 包概覽

[revolution/laravel-boost-phpstorm-copilot](https://github.com/invokable/laravel-boost-phpstorm-copilot) 是 Laravel Boost 的擴充套件包，用於為 **PhpStorm 的 GitHub Copilot 外掛** 增加自定義 agent。

它會在 `php artisan boost:install` 的 AI agent 選項中新增 `PhpStorm with GitHub Copilot`。

<Warning>
  `PhpStorm` 是給 `PhpStorm Junie` 用的選項。請務必選擇 `PhpStorm with GitHub Copilot`。
</Warning>

## 環境要求

* PHP 8.3 及以上
* Laravel 12 及以上
* Laravel Boost 2.0 及以上
* PhpStorm 已安裝 GitHub Copilot 外掛

## 安裝

```shell theme={null}
composer require revolution/laravel-boost-phpstorm-copilot --dev
```

## 用法

<Steps>
  <Step title="執行 Boost 的安裝命令">
    ```shell theme={null}
    php artisan boost:install
    ```
  </Step>

  <Step title="選擇所需功能">
    從 `AI Guidelines` / `Agent Skills` / `Boost MCP Server Configuration` 中選擇所需功能。
  </Step>

  <Step title="在 AI agent 中選擇 PhpStorm with GitHub Copilot">
    在 `Which AI agents would you like to configure?` 中選擇 `PhpStorm with GitHub Copilot`。
  </Step>
</Steps>

## MCP 配置檔案的位置

| OS           | 路徑                                                |
| ------------ | ------------------------------------------------- |
| macOS, Linux | `~/.config/github-copilot/intellij/mcp.json`      |
| Windows      | `%LOCALAPPDATA%\github-copilot\intellij\mcp.json` |

## 重要：切換專案時需要重新執行

在 PhpStorm + GitHub Copilot 外掛中，MCP 配置**不是按專案儲存**，而是儲存在**系統全域性**。
配置檔案中會寫入 Laravel 專案的**絕對路徑**，因此每次切換專案都需要重新生成。

```shell theme={null}
php artisan boost:install --guidelines --skills --mcp --no-interaction
```

<Info>
  Boost 1.8 之後的 `boost:update` 不會更新 MCP 配置檔案。
</Info>

## WSL 支援

本包支援 **PhpStorm 執行在 Windows 端、PHP 執行在 WSL 端** 的組合。

### 前置條件

* 需要 `wslu` 包
* 未安裝時可透過 `sudo apt install wslu` 安裝

### 工作原理

* 透過 `WSL_DISTRO_NAME` 檢測 WSL 環境
* 透過 `wslvar LOCALAPPDATA` 獲取 Windows 端的 AppData 路徑
* 透過 PowerShell 寫入 `%LOCALAPPDATA%\github-copilot\intellij\mcp.json`

### 注意事項

在 WSL 內以遠端開發方式使用 PhpStorm 不在支援範圍內。這種情況下請手動配置 MCP 檔案。

## 不支援 Testbench 以及替代方案

本包不支援在 Testbench 中使用。
如果你在包開發中使用 Testbench，請改用 [laravel-boost-copilot-cli](https://github.com/invokable/laravel-boost-copilot-cli)。

## 相關連結

* [laravel-boost-phpstorm-copilot (GitHub)](https://github.com/invokable/laravel-boost-phpstorm-copilot)
* [Laravel Boost (GitHub)](https://github.com/laravel/boost)
* [GitHub Copilot plugin for PhpStorm](https://plugins.jetbrains.com/plugin/17718-github-copilot)


## Related topics

- [Laravel Boost Custom Agent for GitHub Copilot CLI](/zh-TW/packages/laravel-boost-copilot-cli.md)
- [建立 Boost 的自定義 Agent](/zh-TW/advanced/boost-custom-agent.md)
- [我的套件](/zh-TW/packages/index.md)
- [我的包](/zh-CN/packages/index.md)
- [安裝](/zh-TW/installation.md)
