VOOZH about

URL: https://deepwiki.com/invokable/laravel-boost-phpstorm-copilot/5-platform-specific-implementations

⇱ Platform-Specific Implementations | invokable/laravel-boost-phpstorm-copilot | DeepWiki


Loading...
Last indexed: 28 February 2026 (57ef88)
Menu

Platform-Specific Implementations

This section documents how laravel-boost-phpstorm-copilot handles the four distinct runtime environments a developer may be using: macOS/Linux, Windows native, WSL, and Laravel Sail. Each environment requires different detection logic, a different mcp.json write location, and in some cases a different command format for the MCP server entry.

This page is a section index. For implementation details about the PhpStormCopilot class and the WithWSL trait (which contain the code described here), see Core Implementation. For the exact mcp.json schema and per-platform annotated examples, see MCP Configuration Format and Examples.


Overview of the Four Environments

The package recognises four distinct execution contexts. The installFileMcp method in src/PhpStormCopilot.php119-132 acts as the top-level dispatcher, routing each context to the appropriate handler.

EnvironmentDetection mechanismmcp.json write locationHandler
macOSPlatform::Darwin~/.config/github-copilot/intellij/mcp.jsonparent::installFileMcp
Linux (native)Platform::Linux~/.config/github-copilot/intellij/mcp.jsonparent::installFileMcp
Windows (native)Platform::Windows%LOCALAPPDATA%\github-copilot\intellij\mcp.jsonparent::installFileMcp
WSLWSL_DISTRO_NAME env var set%LOCALAPPDATA%\github-copilot\intellij\mcp.json (Windows side)installMcpViaWsl
Laravel Sailcommand ends with /vendor/bin/sailsame as above per OStransformSailCommandparent::installFileMcp

Sources: src/PhpStormCopilot.php99-132 README.md16-44


Environment Detection Architecture

Two mechanisms drive detection. System detection (via systemDetectionConfig) checks whether PhpStorm is installed at all. Context detection (in installFileMcp) determines at install time which code path to execute.

Diagram: Detection Entry Points


Sources: src/PhpStormCopilot.php119-132 src/Concerns/WithWSL.php11-14


System-Wide Detection Paths by Platform

systemDetectionConfig(Platform $platform) returns the filesystem paths that indicate PhpStorm is installed. These are checked by the Laravel Boost framework before offering the agent as a choice during boost:install.

Diagram: systemDetectionConfig per Platform value


The WSL entry under Platform::Linux (/mnt/c/Users/*/AppData/Local/github-copilot) is notable: it enables detection of a Windows-side GitHub Copilot installation when PHP is running in WSL.

Sources: src/PhpStormCopilot.php39-67


mcp.json Write Locations

mcpConfigPath() src/PhpStormCopilot.php104-114 returns the write destination. For WSL, this method is not used directly — installMcpViaWsl in the WithWSL trait computes the Windows path using wslvar LOCALAPPDATA at runtime.

Platform valuemcpConfigPath() return value
Platform::Darwin$HOME/.config/github-copilot/intellij/mcp.json
Platform::Linux$HOME/.config/github-copilot/intellij/mcp.json
Platform::Windows%LOCALAPPDATA%\github-copilot\intellij\mcp.json
WSL (runtime)resolved via wslvar LOCALAPPDATA{LOCALAPPDATA}\github-copilot\intellij\mcp.json

Sources: src/PhpStormCopilot.php104-114 src/Concerns/WithWSL.php16-76


Subpage Index

Each environment has its own detailed page:

PageTitleTopics
5.1macOS and Linux SupportPlatform::Darwin, Platform::Linux, JetBrains Toolbox paths, standard install flow
5.2Windows Native SupportPlatform::Windows, %LOCALAPPDATA% path handling
5.3WSL (Windows Subsystem for Linux)isWSL(), installMcpViaWsl(), transformMcpCommandForWsl(), wslvar, PowerShell, Base64 encoding
5.4Laravel Sail IntegrationtransformSailCommand(), bash -c cd && sail, Sail in WSL via transformMcpCommandForWsl()

Key Code Entities at a Glance

Diagram: Classes, Traits, and Methods Involved in Platform Handling


Sources: src/PhpStormCopilot.php1-187 src/Concerns/WithWSL.php1-129