npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@changangus/coc-laravel

v0.8.2

Published

Laravel extension for coc.nvim

Downloads

362

Readme

coc-laravel

Laravel extension for coc.nvim.

Note: This is a fork of @yaegassy/coc-laravel with bug fixes and additional features.

What's Changed

Bug Fixes

  • Fixed PHP 8.5 deprecation warnings breaking the extension: PHP 8.5 outputs deprecation notices (e.g., Deprecated: Constant PDO::MYSQL_ATTR_SSL_CA...) to stdout, which corrupted artisan tinker output used for config/path resolution. This caused ENAMETOOLONG errors when the extension tried to use the polluted output as file paths. All artisan command output is now sanitized by stripping PHP warning/notice lines before processing.

New Features

  • Config go-to-definition: Jump from config('app.name') to config/app.php at the exact key, with nested key support. Works in both PHP and Blade files.
  • Translation go-to-definition: Jump from __('messages.welcome'), trans(), or @lang() to the corresponding entry in your lang files. Works in both PHP and Blade files.
  • Route go-to-definition: Jump from route('users.index') to both the route definition in routes/*.php (where ->name() is called) and the controller action method. Works in both PHP and Blade files.
  • Event/listener navigation: Jump from event(new OrderShipped(...)) or OrderShipped::dispatch() to the event class and all registered listener classes (parsed from EventServiceProvider).
  • Controller action completion: In route definitions like Route::get('/users', [UserController::class, '']), get completion for the controller's public methods.
  • Eloquent relationship completion: Model field completion now also includes relationships parsed from @property-read annotations in _ide_helper_models.php.
  • Policy method completion: Complete policy method names in @can(), authorize(), Gate::allows(), and similar constructs. Policies are discovered from app/Policies/ and AuthServiceProvider.

Package Updates

  • Updated all dependencies to latest versions
  • Fixed esbuild config for compatibility with esbuild v0.27+
  • Pinned stillat-blade-parser to v1.2.0 (v2 is not yet compatible)

Install

CocInstall:

:CocInstall @changangus/coc-laravel

vim-plug:

Plug 'changangus/coc-laravel', {'do': 'npm install --legacy-peer-deps && npm run build'}

Features

Note:

This coc-extension executes artisan commands in the background for some features. Therefore, you must be able to run PHP in your environment.


This coc-extension will provide various completion features and more features for Laravel projects.

  • Completions
    • Component completion | DEMO
    • Livewire completion (Also compatible with Livewire v3!)
      • Livewire tag completion | DEMO
      • Livewire action completion | DEMO
      • Livewire event completion | DEMO
      • Livewire property completion | DEMO
      • Livewire directive completion | DEMO
    • PHP completion in PHP-related region of Blade file
      • [NOTE]: To use this feature, please execute the laravel.stubs.download command.
      • PHP Function completion | DEMO
      • PHP Class completion | DEMO
      • PHP Static Class completion (Static class members and constants, e.g. DateTime::|) | DEMO
      • PHP Object Member completion (e.g. $obj->|) | DEMO
      • PHP Variable completion | DEMO
      • PHP Constant completion | DESCRIPTION
      • PHP Keyword completion | DESCRIPTION
    • Directive completion | DEMO
    • Config completion | DEMO
    • Env completion | DEMO
    • Validation completion | DEMO
    • Route completion | DEMO
    • View completion | DEMO
    • Middleware completion | DEMO
    • Guard completion | DEMO
    • Translation completion | DEMO
    • Method directive parameter completion | DEMO
    • View reference variable completion | DEMO
    • Eloquent model field completion | DEMO
      • Completion feature using _ide_helper_models.php file generated by laravel-ide-helper
      • Now also includes relationship completion from @property-read annotations
    • Controller action completion (NEW)
      • Complete controller method names in route definitions, e.g. Route::get('/users', [UserController::class, '|'])
    • Policy method completion (NEW)
      • Complete policy method names in @can(), authorize(), Gate::allows(), etc.
      • Discovers policies from app/Policies/ and AuthServiceProvider
    • Misc
  • Definitions
    • View definition | DEMO
      • [PHP -> Blade] Definition jump to the Blade template specified by the view() function.
    • Blade View definition | DEMO
      • [Blade -> Blade] Jump to the Blade template specified by the @extends and @include directives.
    • Component definition | DEMO
      • [Blade -> PHP or Blade] Jump to the component file. Both class components and anonymous components are supported.
    • Livewire tag definition | DEMO
      • [Blade -> PHP or Blade] Jump to the livewire file. Both livewire class and blade template are supported.
    • Livewire directive definition | DEMO
      • [Blade -> PHP or Blade] Jump to the livewire file. Both livewire class and blade template are supported.
    • Config definition (NEW)
      • [PHP/Blade -> PHP] Jump from config('app.name') to the config file at the exact key.
    • Translation definition (NEW)
      • [PHP/Blade -> PHP] Jump from __('messages.welcome'), trans(), or @lang() to the lang file entry.
    • Route definition (NEW)
      • [PHP/Blade -> PHP] Jump from route('name') to the route definition and controller action.
    • Event/listener definition (NEW)
      • [PHP -> PHP] Jump from event() or Event::dispatch() to event class and listener files.
  • References
    • laravel.view.findAllReferences command | DEMO
      • [Blade -> PHP] Show references to PHP files that use the current blade file. Referenced directories are routes, app/Http/Controllers, app/View/Components, app/Http/Livewire and app/Livewire.
    • View reference | DEMO
      • [PHP -> Blade] Reference to a PHP file that uses the same template in the view function.
  • Hovers
    • ComponentTag Hover | DEMO
  • Diagnostics
    • Missing component validation | DEMO
    • Method directive parameter validation | DEMO
  • CodeActions
    • Create blade component | DEMO
    • Fix method directive parameter | DEMO
  • Artisan and Sail commands integration
    • laravel.artisan.run command feature.
    • laravel.sailArtisan.run command feature.

[RECOMMENDED] Additional installation of "watchman"

coc-laravel uses the workspace/didChangeWatchedFiles notification to monitor files in the project.

In coc.nvim, it is recommended to install watchman in order to utilize this feature.

If you have difficulty installing watchman, you can use coc-laravel without watchman, but you may not be able to immediately use IntelliSense with the newly added files.

In this case, please manually enter the following command.

  • :CocCommand laravel.project.restart

or

  • :CocRestart

workspaceFolders

Depending on the project like mono repo or how Vim/Neovim is started, workspaceFolders may not be recognized correctly.

To make coc.nvim recognize workspaceFolders correctly, you can set b:coc_root_patterns in .vimrc/init.vim

Example:

  au FileType php,blade let b:coc_root_patterns = ['.git', '.env', 'composer.json', 'artisan']

For more information, check this coc.nvim's wiki.

Configuration options

  • laravel.enable: Enable coc-laravel extension, default: true
  • laravel.environment.phpPath: Path to PHP, you can use a custom version of PHP. If there is no setting, php of the execution environment will be used, default: ""
  • laravel.project.excludeVendors: List of target vendor directories to exclude during project analysis, e.g. ["fakerphp", "phpunit"], default: []
  • laravel.project.startupMessageEnable: Enable project startup messages, default: true
  • laravel.stubs.customVersion: Specify the version of stubs to download with the laravel.stubs.download command. If not set, the stubsVersion defined in package.json will be used, default: ""
  • laravel.stubs.useStubs: List of stubs to be used, default: ["Core", "date", "standard"]
  • laravel.completion.enable: Enable all completion feature, default: true
  • laravel.completion.directiveEnable: Enable directive completion, default: true
  • laravel.completion.directiveList: List of directive used in directive completion, default: Omitted due to the large number of settings, See configuration in package.json
  • laravel.completion.configEnable: Enable config completion, default: true
  • laravel.completion.envEnable: Enable env completion, default: true
  • laravel.completion.validationEnable: Enable validation completion.
  • laravel.completion.routeEnable: Enable route completion, default: true
  • laravel.completion.viewEnable: Enable view completion, default: true
  • laravel.completion.middlewareEnable: Enable middleware completion, default: true
  • laravel.completion.guardEnable: Enable guard completion, default: true
  • laravel.completion.translationEnable: Enable translation completion, default: true
  • laravel.completion.componentEnable: Enable component completion, default: true
  • laravel.completion.phpFunctionEnable: Enable php function completion, default: true
  • laravel.completion.phpFunction.stubsEnable: Enable stubs in phpFunction completion, default: true
  • laravel.completion.phpFunction.vendorEnable: Enable vendor in phpFunction completion, default: true
  • laravel.completion.phpClassEnable: Enable php class completion, default: true
  • laravel.completion.phpClass.stubsEnable: Enable stubs in phpClass completion, default: true
  • laravel.completion.phpClass.vendorEnable: Enable vendor in phpClass completion, default: true
  • laravel.completion.phpConstantEnable: Enable php constant completion, default: true
  • laravel.completion.phpConstant.stubsEnable: Enable stubs in phpConstant completion, default: true
  • laravel.completion.phpConstant.vendorEnable: Enable vendor in phpConstant completion, default: true
  • laravel.completion.phpStaticClassEnable: Enable php static class completion, default: true
  • laravel.completion.phpObjectMemberEnable: Enable php object member completion, default: true
  • laravel.completion.phpVariableEnable: Enable php variable completion, default: true
  • laravel.completion.phpKeywordEnable: Enable php keyword completion, default: true
  • laravel.completion.eloquentModelFieldEnable: Enable eloquent model field completion, default: true
  • laravel.completion.controllerActionEnable: Enable controller action method completion in route definitions, default: true
  • laravel.completion.policyMethodEnable: Enable policy method completion, default: true
  • laravel.completion.viewReferenceVariableEnable: Enable view reference variable completion, default: true
  • laravel.completion.methodParameterEnable: Enable method parameter completion, default: true
  • laravel.completion.livewireEnable: Enable livewire completion, default: true
  • laravel.livewire.wireClickAttributes: List of click related action to be added to wire:xxxx, default: ["click", "click.prefetch"]
  • laravel.livewire.wireModelAttributes: List of model related action to be added to wire:xxxx, default: ["model", "model.debounce.100ms", "model.lazy", "model.defer"]
  • laravel.livewire.wireEventAttributes: List of browser events to be added to wire:xxxx. No need for wire:model or wire:click. default: Omitted due to the large number of settings, See configuration in package.json
  • laravel.definition.enable: Enable definition, default true
  • laravel.definition.configEnable: Enable go-to-definition for config() calls, default: true
  • laravel.definition.translationEnable: Enable go-to-definition for __(), trans(), and @lang() calls, default: true
  • laravel.definition.routeEnable: Enable go-to-definition for route() calls, default: true
  • laravel.definition.eventEnable: Enable go-to-definition for event dispatch to event class and listeners, default: true
  • laravel.reference.enable: Enable reference, default true
  • laravel.hover.enable: Enable hover, default true
  • laravel.diagnostic.enable: Enable diagnostic, default: true
  • laravel.codeAction.enable: Enable code action, default: true
  • laravel.artisan.withoutArgumentsCommandList: List of commands to quickly execute laravel.artisan.run or laravel.sailArtisan.run without prompting for arguments or options, e.g. ["route:list", "clear-compiled"], default: []
  • laravel.artisan.enableSplitRight: Use vertical belowright for artisan terminal window, default: false

Commands

  • laravel.project.restart: Run project restart
  • laravel.project.stats: (Develop) Show project stats
  • laravel.project.finder: (Develop) Run project finder
  • laravel.stubs.download: Download stubs
  • laravel.stubs.version: Show the version of stubs
  • laravel.artisan.run: Run artisan command
  • laravel.sailArtisan.run: Run sail artisan command
  • laravel.view.findAllReferences: Find view file references
  • laravel.showOutput: Show laravel output channel

CodeActions

Example key mapping (Code Action related):

nmap <silent> ga <Plug>(coc-codeaction-line)
nmap <silent> <leader>ac <Plug>(coc-codeaction-cursor)

Actions:

  • Create blade component
  • Fix method directive parameter

Recommended coc-extensions for php

Based on

This project is based on @yaegassy/coc-laravel by yaegassy. Thank you for the excellent foundation.

Inspired Projects

Thanks

License

MIT


This extension is built with create-coc-extension