Skip to main content
This article reflects v0.0.27, as of July 2026. Laravel LSP is now registered on Packagist and can be installed with composer global require laravel/lsp.

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 and configure the official Laravel Sublime Text extension.

Zed

Install and configure the official Laravel Zed extension.

VS Code

Install and configure the official Laravel VS Code extension.

Cursor

Cursor supports VS Code extensions, so the Laravel VS Code extension above works as-is.

Neovim

On Neovim 0.11+, you can add a custom LSP configuration directly:
If you use nvim-lspconfig, register it like this:

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

Pest helper docblocks

Added in v0.0.27. Generates and keeps Pest helper docblocks up to date whenever tests or Composer autoload files change:

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 25, 2026