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.

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
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $7500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
Laravel Idea for PhpStorm logo

Laravel Idea for PhpStorm

Ultimate PhpStorm plugin for Laravel developers, delivering lightning-fast code completion, intelligent navigation, and powerful generation tools to supercharge productivity.

Laravel Idea for PhpStorm
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
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
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
Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate logo

Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate

Build your SaaS application in hours. Out-of-the-box multi-tenancy and seamless Stripe integration. Supports subscriptions and one-time purchases, allowing you to focus on building and creating without repetitive setup tasks.

Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate
JetShip - Laravel Starter Kit logo

JetShip - Laravel Starter Kit

A Laravel SaaS Boilerplate and a starter kit built on the TALL stack. It includes authentication, payments, admin panels, and more. Launch scalable apps fast with clean code, seamless deployment, and custom branding.

JetShip - Laravel Starter Kit
Rector logo

Rector

Your partner for seamless Laravel upgrades, cutting costs, and accelerating innovation for successful companies

Rector
MongoDB logo

MongoDB

Enhance your PHP applications with the powerful integration of MongoDB and Laravel, empowering developers to build applications with ease and efficiency. Support transactional, search, analytics and mobile use cases while using the familiar Eloquent APIs. Discover how MongoDB's flexible, modern database can transform your Laravel applications.

MongoDB

The latest

View all →
Laravel VS Code Extension Public Beta image

Laravel VS Code Extension Public Beta

Read article
Wirechat - Laravel Livewire chat package image

Wirechat - Laravel Livewire chat package

Read article
Laravel whenLoaded - Performance Optimization via Conditional Relationship Loading image

Laravel whenLoaded - Performance Optimization via Conditional Relationship Loading

Read article
Announcing Inertia 2.0: Redefining Frontend Development for Laravel image

Announcing Inertia 2.0: Redefining Frontend Development for Laravel

Read article
Converting Collections to Queries in Laravel Using toQuery() image

Converting Collections to Queries in Laravel Using toQuery()

Read article
Dynamic Page Updates with Laravel Blade Fragments image

Dynamic Page Updates with Laravel Blade Fragments

Read article