This article is initial research on v0.0.19, as of June 2026. Because it isn’t registered on Packagist yet, you can’t install it via Composer.
What is Laravel LSP?
Laravel LSP (Language Server Protocol) is Laravel’s official tool that brings framework-aware IDE features to your editor. The Language Server Protocol is a standard protocol for communication between an LSP client (your editor) and an LSP server (Laravel LSP), enabling a unified development experience across multiple editors. Features provided by Laravel LSP:- Completion — Auto-complete routes, views, config keys, translation keys, Livewire components, and more
- Hover info — Show descriptions, documentation, and context info when hovering
- Diagnostics — Detect issues in your code in real time
- Document links — Link between files and resources
- Quick fixes — Auto-fix suggestions for common issues
- Go to definition — Jump to a symbol’s definition
Why you need it
The editor’s built-in PHP completion doesn’t understand the Laravel framework’s abstraction layers. For example:- No completion for the URI pattern as the first argument of
Route::get() - Entering a view name in
view('users.index')doesn’t complete against actual view files - Config keys (
config('app.name')) and translation keys (trans('messages.welcome')) aren’t included in completion - Completion and validation inside Blade templates aren’t supported by default
Installation
Global installation
Install globally with Composer:PATH. You can then start it with:
Installation from source
To use the development version, clone the repository and run it:laravel-lsp command:
Editor configuration guides
Because Laravel LSP uses the standard LSP protocol, it works with any editor that supports LSP. Here are configurations for major editors.Sublime Text
Install the LSP package, then add a client config viaPreferences: LSP Settings:
Neovim
On Neovim 0.11+, you can add a custom LSP configuration directly:nvim-lspconfig, register it like this:
Cursor
Cursor supports VS Code extensions, so if the Laravel extension is installed it’s automatically supported. For local development, use a VS Code-compatible LSP client and specify the command:VS Code
VS Code likewise has LSP client capabilities and can be configured through extensions.OpenCode
Enable LSP support inopencode.json and configure Laravel LSP as a custom server:
Configuring with the GitHub Copilot CLI
When using the GitHub Copilot CLI, you can configure it globally in~/.copilot/lsp-config.json. No separate editor configuration is required:
initializationOptions, so you can use all the detailed settings described below.
Configuration options
LSP clients can pass detailed configuration to Laravel LSP throughinitializationOptions.
PHP environment detection
ThephpEnvironment option controls the PHP command used to index project data. The default is auto, which auto-detects:
If detection fails or an invalid value is passed, it falls back to
php.
Basic configuration example
Per-feature configuration
Each feature can be individually enabled or disabled. Suffixes includeCompletion, Diagnostics, Hover, Link, and so on:
Provided features overview
Quick start
- Install —
composer global require laravel/lsp - Configure your editor — see the per-editor guides above
- Open a Laravel project — the server indexes project data from the root: routes, views, translations, config, etc.
- Use completion — framework-aware completion works automatically inside PHP files and Blade templates
Summary
Laravel LSP significantly improves the developer experience. It understands framework-specific context that the editor’s default features can’t, and delivers more accurate and useful completion and diagnostics. Requirements:- PHP 8.2 or later
- Composer
- An LSP-capable editor (Sublime Text, Neovim, Cursor, VS Code, etc.)