laravel/lsp) is a modular addition to Laravel’s ecosystem, designed to enhance IDE/editor integration (e.g., IntelliSense, autocompletion, refactoring) without altering core Laravel architecture. It aligns well with microservice-like extensions (e.g., language servers) that operate as standalone services but integrate deeply with the host application.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| IDE Plugin Fragmentation | Medium | Standardize on VS Code + PHP Intelephense as primary client. |
| Memory Leaks | High | Implement garbage collection hooks for LSP state. |
| LSP Protocol Breaking Changes | Medium | Pin to stable LSP versions (e.g., v3.17). |
| Legacy Laravel Support | Low | Use adapters for DI/container differences. |
| Network Latency (Remote LSP) | Medium | Default to local mode; offer remote as optional. |
| Component | Compatibility | Notes |
|---|---|---|
| Laravel 11+ | ✅ Native | Designed for modern Laravel. |
| PHP 8.2+ | ✅ Required | LSP relies on PHP attributes and modern syntax. |
| VS Code | ✅ Native | Built-in LSP support via php-language-server. |
| PHPStorm | ✅ Native | Supports LSP via plugins (e.g., "Language Server Protocol"). |
| Neovim | ✅ (Plugin) | Requires nvim-lspconfig or similar. |
| Docker | ✅ Optional | Can run LSP in a separate container for isolation. |
| Redis | ✅ Optional | Useful for caching static analysis results. |
| Queue Workers | ✅ Optional | Offload heavy analysis to background jobs. |
Phase 1: Local Development
laravel/lsp via Composer.settings.json):
"php.validate.executablePath": "vendor/bin/laravel-lsp",
"php.validate.run": "onType"
Phase 2: Remote LSP (Optional)
laravel-lsp:latest).http://lsp-service:3000.Phase 3: CI/CD Enforcement
php-cs-fixer + LSP rules).vendor/bin/laravel-lsp validate --rules=type-hints,no-undefined
@directive handling).composer require laravel/lsp --dev
vendor/ and node_modules/ from analysis..lspignore for large directories.laravel/lsp and LSP protocol updates (e.g., v3.x → v4.0).composer.json..env:
LSP_LOG_LEVEL=debug
vendor/bin/laravel-lsp index.php.suggest.autocomplete tweaks.tests/, storage/ via .lspignore.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| LSP Crashes | IDE becomes unusable | Auto-restart via supervisord. |
| Network Failure (Remote LSP) | Editor loses features |
How can I help you explore Laravel packages today?