Join the Mastering Laravel community to level up your skills and get trusted advice

Laravel VS Code Extension Public Beta

Published on by

Laravel VS Code Extension Public Beta image

VS Code has firmly established itself as the go-to editor for developers worldwide. While PHPStorm seems to be the preferred choice for Laravel developers, many, especially those transitioning from other languages, are comfortable and would prefer to do Laravel development in VS Code.

There is some Laravel support in VS Code through various extensions, but a truly seamless and integrated experience was missing. Recognizing this need, at Laracon US 2024 the Laravel core team announced the ambitious task of creating an official VS Code extension for Laravel. The wait is finally over, as the public beta is now available.

The new Laravel VS Code extension is set to enhance your development workflow by providing a suite of helpful features. It offers improved autocomplete, enhanced navigation with click-to-source functionality, and other tools to streamline your Laravel development experience. It can:

  • Auto-complete - for app bindings, config and environment variables, routes, models, views, and more.
  • Link directly to definitions for routes, models, and config values.
  • Warn if something's missing, like a config value or a blade template, and sometimes suggest fixes.
  • Provide more helpful information when you hover over the code.

More Features

Here is a non-exhaustive list of features covered in the extension so far:

App Bindings

app('auth')
App::make('auth.driver')
app()->make('auth.driver')
App::bound('auth.driver')
App::isShared('auth.driver')
// etc
  • Auto-completion
  • Links directly to binding
  • Warns when binding not found
  • Hoverable

Assets

asset('my-amazing-jpeg.png')
  • Auto-completion
  • Links directly to asset
  • Warns when asset not found
  • Blade
  • Syntax highlighting

Config

config('broadcasting.connections.reverb.app_id');
Config::get('broadcasting.connections.reverb.app_id');
Config::getMany([
'broadcasting.connections.reverb.app_id',
'broadcasting.connections.reverb.driver',
]);
config()->string('broadcasting.connections.reverb.app_id');
// etc
  • Auto-completion
  • Links directly to config value
  • Warns when config not found
  • Hoverable

Eloquent

  • Method auto-completion
  • Field auto-completion (e.g. where methods, create/make/object creation)
  • Relationship auto-completion (e.g. with method + with with array keys)
  • Sub-query auto-completion ( with with array keys + value as closure)

Env

env('REVERB_APP_ID');
Env::get('REVERB_APP_ID');
  • Auto-completion
  • Links directly to env value
  • Warns when env not found, offers quick fixes:
  • Add to .env
  • Copy value from .env.example
  • Hoverable

Inertia

inertia('Pages/Dashboard');
Inertia::render('Pages/Dashboard');
Route::inertia('/dashboard', 'Pages/Dashboard');
  • Auto-completion
  • Links directly to JS view
  • Warns when view not found, offers quick fixes:
  • Create view
  • Hoverable

Route

route('dashboard');
signedRoute('dashboard');
Redirect::route('dashboard');
Redirect::signedRoute('dashboard');
URL::route('dashboard');
URL::signedRoute('dashboard');
Route::middleware('auth');
redirect()->route('dashboard');
// etc
  • Auto-completion
  • Links directly to route definition
  • Warns when route not found
  • Hoverable

Middleware

Route::middleware('auth');
Route::middleware(['auth', 'web']);
Route::withoutMiddleware('auth');
// etc
  • Auto-completion
  • Links directly to middleware handling
  • Warns when middleware not found
  • Hoverable

Translation

trans('auth.failed');
__('auth.failed');
Lang::has('auth.failed');
Lang::get('auth.failed');
// etc
  • Auto-completion
  • Links directly to translation
  • Warns when translation not found
  • Hoverable
  • Parameter auto-completion

Validation

Validator::validate($input, ['name' => 'required']);
request()->validate(['name' => 'required']);
request()->sometimes(['name' => 'required']);
// etc
  • Auto-completion for strings/arrays (not "|" just yet)

View

view('dashboard');
Route::view('/', 'home');
  • Auto-completion
  • Links directly to Blade view
  • Warns when view not found, offers quick fixes:
  • Create view
  • Hoverable

More on the roadmap

Some things that are on the roadmap are:

  • Integration with VS Code test runner
  • Livewire support
  • Volt support
  • Pint support
  • Better autocompletion, linking, hovering, and diagnostics in Blade files

The extension is currently in Open Beta Testing. To provide feedback or report issues, follow the support instructions provided by the Laravel core team. Your input will help shape the future of this extension and make it the best-in-class Laravel VS Code extension.

Learn more about this extension on the marketplace and view the source code on Github.

Yannick Lyn Fatt photo

Research Assistant at Laravel News and Full stack web developer.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Tinkerwell

Enjoy coding and debugging in an editor designed for fast feedback and quick iterations. It's like a shell for your application – but with multi-line editing, code completion, and more.

Visit Tinkerwell
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $2500/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Laravel Forge logo

Laravel Forge

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Forge
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Cut PHP Code Review Time & Bugs into Half with CodeRabbit logo

Cut PHP Code Review Time & Bugs into Half with CodeRabbit

CodeRabbit is an AI-powered code review tool that specializes in PHP and Laravel, running PHPStan and offering automated PR analysis, security checks, and custom review features while remaining free for open-source projects.

Cut PHP Code Review Time & Bugs into Half with CodeRabbit
Join the Mastering Laravel community logo

Join the Mastering Laravel community

Connect with experienced developers in a friendly, noise-free environment. Get insights, share ideas, and find support for your coding challenges. Join us today and elevate your Laravel skills!

Join the Mastering Laravel community
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
LaraJobs logo

LaraJobs

The official Laravel job board

LaraJobs
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit

The latest

View all →
Auto-translate Application Strings with Laratext image

Auto-translate Application Strings with Laratext

Read article
Simplify Factory Associations with Laravel's UseFactory Attribute image

Simplify Factory Associations with Laravel's UseFactory Attribute

Read article
Improved Installation and Frontend Hooks in Laravel Echo 2.1 image

Improved Installation and Frontend Hooks in Laravel Echo 2.1

Read article
Filter Model Attributes with Laravel's New except() Method image

Filter Model Attributes with Laravel's New except() Method

Read article
Arr::from() Method in Laravel 12.14 image

Arr::from() Method in Laravel 12.14

Read article
Streamline API Resources with Laravel's Fluent Methods image

Streamline API Resources with Laravel's Fluent Methods

Read article