4,000 emails/month for free | Mailtrap sends real emails now!

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

Staff Writer 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
Laravel Code Review

Get expert guidance in a few days with a Laravel code review

Visit Laravel Code Review
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 $3200/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Tinkerwell logo

Tinkerwell

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

Tinkerwell
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Laravel Cloud logo

Laravel Cloud

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

Laravel Cloud
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
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Lucky Media logo

Lucky Media

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

Lucky Media
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 →
Bagisto Visual: Theme Framework with Visual Editor for Laravel E-commerce image

Bagisto Visual: Theme Framework with Visual Editor for Laravel E-commerce

Read article
Automate Laravel Herd Worktrees with This Claude Code Skill image

Automate Laravel Herd Worktrees with This Claude Code Skill

Read article
Laravel Boost v2.0 Released with Skills Support image

Laravel Boost v2.0 Released with Skills Support

Read article
Laravel Debugbar v4.0.0 is released image

Laravel Debugbar v4.0.0 is released

Read article
Radiance: Generate Deterministic Mesh Gradient Avatars in PHP image

Radiance: Generate Deterministic Mesh Gradient Avatars in PHP

Read article
Speeding Up Laravel News With Cloudflare image

Speeding Up Laravel News With Cloudflare

Read article