img
AboutContactBlogGet in touch

7 min read

Laravel VS Code Extension: Features, Updates, and Roadmap

Interested in generating passive income? Join our partnership program and receive a commission on each new client referral. Learn more.

laravel vs code extension
When the Laravel core team teased the upcoming Laravel VS Code extension at Laracon EU 2024, we couldn’t wait to get our hands on it. Well, the wait is finally over - the public beta version of
Laravel VS Code Extension is officially available. From autocompletion to diagnostics, it’s packed with features that serve Laravel developers' unique needs and make coding faster and more efficient.

So, let’s take a closer look at the standout features and get a glimpse of what’s in store for the future.

Some of the Features We Loved

App Bindings

One of the most impressive features of the official Laravel VS Code Extension is its support for App Bindings. This feature makes working with Laravel bindings intuitive and efficient by offering several helpful capabilities.

The extension provides auto-completion for common bindings such as app('auth'), App::make('auth.driver'), and similar methods. It doesn’t stop at suggesting bindings; it links directly to them and allows you to quickly navigate to their definitions. It also warns you if a binding is not found and helps you to catch potential issues early on in development. You can also hover over bindings to view detailed information.

This feature significantly speeds up coding by reducing the need to manually search for or verify bindings. Whether you’re exploring new code or revisiting an older project, having direct links and hoverable insights ensures you stay focused on writing clean and error-free code.

Assets

One of the standout features of the Laravel VS Code Extension is how it simplifies managing static assets.

The extension offers auto-completion for asset('...') calls, ensuring you have quick access to all your asset files. It links directly to the corresponding asset. If an asset is missing or the path contains a typo, the extension provides a warning to help you catch issues before they become bugs.

Broken image or script paths can turn into frustrating debugging sessions, especially in large projects. So, this feature reduces that risk and makes sure your asset references are correct from the start. It’s a simple yet effective way to prevent errors and maintain a smooth development workflow.

asset('my-amazing-jpeg.png');

As you type the asset name, the extension suggests available files through auto-completion, making the process faster and more accurate. If the file doesn’t exist, it immediately flags a warning so you can fix the issue on the spot.

Translation

Multilingual projects can quickly become complex, with countless translation keys to manage. This feature eliminates the guesswork and makes sure keys are valid and correctly referenced. It helps you stay organized, save time and reduce errors.

It provides auto-completion for translation keys, whether you’re using trans('auth.failed'), __('auth.failed'), or Lang::get('auth.failed'). It also warns you if a key doesn’t exist, highlights invalid references, and even supports parameter auto-completion. Plus, it links directly to the translation files, making navigation much easier.

Blade

Writing and maintaining Blade templates is a key part of Laravel development, and the Laravel extension for VS Code makes it a whole lot smoother.

The extension offers improved syntax highlighting for Blade files and makes your templates more visually organized and easier to work with.

Enhanced syntax highlighting makes Blade code clearer and helps you quickly spot issues and maintain a clean structure. This improvement reduces cognitive load, especially in complex templates, so you can focus more on functionality.

View

The extension provides auto-completion for view names, whether you’re using view('dashboard') or Route::view('/', 'home'). It also links directly to the corresponding Blade file and warns if a view is missing. In such cases, it offers quick fixes like creating the view directly from the editor. You can also hover over view references to see additional details.

Overall, this feature saves time and reduces errors when working with Blade templates. By catching missing views early and providing quick fixes, you’ll ensure smoother workflows and fewer interruptions.

Config

Working with Laravel’s configuration files can sometimes be error-prone, especially when managing large-scale applications. This feature reduces mistakes by ensuring that all keys are valid and correctly linked to the actual configuration file.

The extension offers auto-completion for config() calls, such as config('broadcasting.connections.reverb.app_id'). It links directly to the config file and highlights invalid keys, providing warnings when a config key doesn’t exist.

Let’s take a look at the quick example:

config('broadcasting.connections.reverb.driver');

As you type the key, the extension suggests valid options and helps you avoid typos. If the key doesn’t exist, you’ll receive a warning, and you’ll be able to fix it immediately. Hovering over the key provides more details, including its file location.

Eloquent

Eloquent is at the heart of Laravel's ORM, and the Official VS code extension for laravel makes it even more powerful with its Eloquent support.

The extension provides method auto-completion for Eloquent models and covers common methods like ->where(), ->create(), and relationship methods such as ->with(). It also supports field auto-completion, ensuring you can quickly access and use model attributes. For more advanced use cases, it includes sub-query auto-completion that will help you easily write complex queries.

This feature is a significant time-saver, especially for developers working with large models or complex relationships. By suggesting the right methods, fields, and keys, it reduces the chances of errors and speeds up the development process.

Big Things Ahead for the Laravel VS Code Extension

The Official Laravel VS Code Extension is already packed with valuable features, but it’s clear that the development team is committed to making it even better. Here are some of the major features planned for future releases:

  • Livewire Support
    Livewire has become a popular tool for building dynamic front-end features with Laravel. Adding support for it will enhance productivity for Livewire developers.

  • Pint Support
    Laravel Pint, the PHP code style fixer, will also be integrated into the extension, which will make it much easier to ensure clean and consistent code formatting directly in VS Code.

  • Enhanced Blade File Features
    The extension is set to deliver better autocompletion, linking, hovering, and diagnostics for Blade templates.

These updates demonstrate that the extension is not just a static tool but an actively developed project with a bright future. With each enhancement, Laravel developers can look forward to an even more seamless and powerful coding experience.

We can’t wait to see how VS code Laravel extension evolves in the future and keeps making Laravel development much smoother for the entire community.

img

Meet the authors

We are a 200+ people agency and provide product design, software development, and creative growth marketing services to companies ranging from fresh startups to established enterprises. Our work has earned us 100+ international awards, partnerships with Laravel, Vue, Meta, and Google, and the title of Georgia’s agency of the year in 2019 and 2021.

img
Contact us