Skip to main content
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
Laravel LSP understands these “framework-specific contexts” and provides accurate completion and diagnostics.

Installation

Global installation

Install globally with Composer:
Make sure Composer’s global bin directory is on your PATH. You can then start it with:

Installation from source

To use the development version, clone the repository and run it:
Set up a shell alias so you can use the 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 via Preferences: LSP Settings:

Neovim

On Neovim 0.11+, you can add a custom LSP configuration directly:
If you use 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 in opencode.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:
Copilot CLI’s LSP server configuration also supports initializationOptions, so you can use all the detailed settings described below.

Configuration options

LSP clients can pass detailed configuration to Laravel LSP through initializationOptions.

PHP environment detection

The phpEnvironment 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 include Completion, Diagnostics, Hover, Link, and so on:

Provided features overview

Quick start

  1. Installcomposer global require laravel/lsp
  2. Configure your editor — see the per-editor guides above
  3. Open a Laravel project — the server indexes project data from the root: routes, views, translations, config, etc.
  4. 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.)
References:
Last modified on July 13, 2026