PHPackages                             laravel/lsp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. laravel/lsp

ActiveProject[Framework](/categories/framework)

laravel/lsp
===========

The Laravel language server.

v0.0.26(1w ago)131↑2900%1[3 issues](https://github.com/laravel/lsp/issues)MITPHPPHP ^8.2.0CI failing

Since May 14Pushed 5d agoCompare

[ Source](https://github.com/laravel/lsp)[ Packagist](https://packagist.org/packages/laravel/lsp)[ Docs](https://github.com/laravel/lsp)[ RSS](/packages/laravel-lsp/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (8)Versions (26)Used By (0)

Laravel LSP
===========

[](#laravel-lsp)

The Laravel language server provides framework-aware editor features for Laravel applications. It runs over stdio using the Language Server Protocol and powers completions, hovers, diagnostics, document links, definitions, and quick fixes for Laravel and Blade code.

Requirements
------------

[](#requirements)

- **PHP 8.2+**
- **Composer**
- **Laravel application** - the server indexes framework data from the project root
- **LSP-compatible editor or client** - such as Sublime Text, Neovim, Cursor, or OpenCode

Installation
------------

[](#installation)

Install Laravel LSP globally with Composer:

```
composer global require laravel/lsp
```

Make sure Composer's global vendor bin directory is on your `PATH`, then run the server with:

```
laravel-lsp
```

### From Source

[](#from-source)

Clone the repository and install dependencies:

```
gh repo clone laravel/lsp
cd lsp
composer install
```

You can run the server from source with:

```
php server
```

Setup Alias
-----------

[](#setup-alias)

To use the `laravel-lsp` command from anywhere, add an alias to your shell configuration:

**For Zsh (macOS default):**

```
echo 'alias laravel-lsp="php '$(pwd)'/server"' >> ~/.zshrc
source ~/.zshrc
```

**For Bash:**

```
echo 'alias laravel-lsp="php '$(pwd)'/server"' >> ~/.bashrc
source ~/.bashrc
```

Or manually add the alias to your `~/.zshrc` or `~/.bashrc` file:

```
alias laravel-lsp="php /path/to/lsp/server"
```

If you are using a downloaded standalone binary, make it executable and put it on your `PATH` instead:

```
chmod +x /path/to/server-vX.Y.Z-arm64-darwin
mv /path/to/server-vX.Y.Z-arm64-darwin /usr/local/bin/laravel-lsp
```

Quick Start
-----------

[](#quick-start)

**Configure** - Point your editor or LSP client at the server command:

```
laravel-lsp
```

**Open Laravel** - Open a Laravel project root in your editor so the server can index routes, views, translations, config, and other project data.

Editor Usage
------------

[](#editor-usage)

The server communicates over stdio. Configure your editor to launch the command from the Laravel project root whenever possible.

### Sublime Text

[](#sublime-text)

Install the [LSP](https://packagecontrol.io/packages/LSP) package, then add a client configuration in `Preferences: LSP Settings`:

```
{
    "clients": {
        "laravel-lsp": {
            "enabled": true,
            "command": ["laravel-lsp"],
            "selector": "embedding.php | text.html.blade"
        }
    }
}
```

### Neovim

[](#neovim)

Neovim 0.11+ is required. Add a custom LSP configuration:

```
vim.lsp.config("laravel_lsp", {
    cmd = { "laravel-lsp" },
    filetypes = { "php", "blade" },
    root_markers = { "artisan", "composer.json", ".git" },
})

vim.lsp.enable("laravel_lsp")
```

### Cursor

[](#cursor)

Cursor supports VS Code extensions, so the simplest setup is to install the Laravel extension that bundles or configures Laravel LSP.

For local development against this repository, use a VS Code-compatible custom LSP extension or client and point it at:

```
laravel-lsp
```

### OpenCode

[](#opencode)

Enable LSP support in `opencode.json` and add Laravel LSP as a custom server:

```
{
    "$schema": "https://opencode.ai/config.json",
    "lsp": {
        "laravel-lsp": {
            "command": ["laravel-lsp"],
            "extensions": [".php", ".blade.php"]
        }
    }
}
```

Features
--------

[](#features)

AreaCapabilitiesRoutesCompletions, hovers, diagnostics, document linksViews and BladeCompletions, hovers, diagnostics, links, fixesTranslationsKey, locale, and parameter completions; hoversConfigKey completions, hovers, diagnostics, linksEnvironment variablesCompletions, hovers, diagnostics, links, fixesAssets and MixCompletions, hovers, diagnostics, linksMiddlewareCompletions, hovers, diagnostics, linksInertiaPage and property completions, links, diagnosticsLivewire componentsCompletions, hovers, linksAuth and policiesCompletions, hovers, diagnostics, linksContainer bindingsCompletions, hovers, diagnostics, linksValidation rulesCompletionsController actionsCompletions, diagnostics, linksEloquentCompletionsConfiguration
-------------

[](#configuration)

Editor clients pass configuration through LSP `initializationOptions`.

OptionDefaultDescription`phpEnvironment``auto`Detect which PHP environment to use for indexing project data`phpCommand`autoExplicit PHP command array, such as `["php"]` or Sail commands`definitionProvider``false`Enable definition support when the client should request itThe `phpEnvironment` option controls which PHP command is used when the server runs project data scripts. It accepts these values:

ValuePHP command behavior`auto`Try Herd, Valet, Sail, Lando, DDEV, then local PHP`herd`Use `herd which-php``valet`Use `valet which-php``sail`Use `./vendor/bin/sail php` when Sail is running`lando`Use `lando php` when available`ddev`Use `ddev php` when available`local`Use the local PHP binary resolved from `php -r 'echo PHP_BINARY;'`If detection fails, or an unknown value is provided, the server falls back to `php`.

Most feature providers can be enabled or disabled individually by passing boolean initialization options. For example:

```
{
    "routeCompletion": true,
    "routeDiagnostics": true,
    "viewDiagnostics": false,
    "translationHover": true
}
```

Common feature option suffixes are `Completion`, `Diagnostics`, `Hover`, and `Link`, such as `routeCompletion`, `configDiagnostics`, `envHover`, or `bladeComponentLink`.

Links
-----

[](#links)

- [Laravel](https://laravel.com)
- [Laravel LSP source](https://github.com/laravel/lsp)

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance94

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

24

Last Release

8d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/463230?v=4)[Taylor Otwell](/maintainers/taylorotwell)[@taylorotwell](https://github.com/taylorotwell)

---

Top Contributors

[![TitasGailius](https://avatars.githubusercontent.com/u/12625773?v=4)](https://github.com/TitasGailius "TitasGailius (76 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (6 commits)")[![joetannenbaum](https://avatars.githubusercontent.com/u/2702148?v=4)](https://github.com/joetannenbaum "joetannenbaum (1 commits)")[![N1ebieski](https://avatars.githubusercontent.com/u/14810714?v=4)](https://github.com/N1ebieski "N1ebieski (1 commits)")[![nunomaduro](https://avatars.githubusercontent.com/u/5457236?v=4)](https://github.com/nunomaduro "nunomaduro (1 commits)")

---

Tags

phplaravelLSPLanguage server

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/laravel-lsp/health.svg)

```
[![Health](https://phpackages.com/badges/laravel-lsp/health.svg)](https://phpackages.com/packages/laravel-lsp)
```

###  Alternatives

[pestphp/pest-plugin-laravel

The Pest Laravel Plugin

22750.9M10.9k](/packages/pestphp-pest-plugin-laravel)[dragon-code/support

Support package is a collection of helpers and tools for any project.

239.6M106](/packages/dragon-code-support)[kompo/kompo

Laravel &amp; Vue.js FullStack Components for Rapid Application Development

11914.4k42](/packages/kompo-kompo)[tomatophp/filament-cms

Full CMS System with support of importing integrations and multi meta functions

12111.9k4](/packages/tomatophp-filament-cms)[gdg-tangier/cloud-pubsub

Google Cloud pub-sub for laravel

5056.7k](/packages/gdg-tangier-cloud-pubsub)[hypervel/framework

The Hypervel framework.

1116.7k8](/packages/hypervel-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
