Visual Studio Code Laravel



Tooling

Laravel ide helper is a package that generates helper files that enable your IDE to provide accurate autocompletion. Generation is done based on the files in your project, so they are always up-to-date.,laravel-intellisense. Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, and caching.

Out of the blue, Microsoft jumps into the editor wars with an incredible offering that gives Sublime Text an overwhelming run for its money. In fact, it just might surpass it! So come along, as I demonstrate the ins, the outs, the tips, the techniques. Say hello to your new best friend: Visual Studio Code.

Intermediate
Latest Episode in This Series
Laravel

Visual Studio Code For Windows

Added 3 years ago

Type Checking JavaScript Files

What if we could add a single commented line to the top of any vanilla JavaScript file,...

Watch

Out of the blue, Microsoft jumps into the editor wars with an incredible offering that gives Sublime Text an overwhelming run for its money. In fact, it just might surpass it! So come along, as I demonstrate the ins, the outs, the tips, the techniques. Say hello to your new best friend: Visual Studio Code.

Latest Episode in This Series

Added 3 years ago

Type Checking JavaScript Files

What if we could add a single commented line to the top of any vanilla JavaScript file,...
Watch

Your Teacher |Jeffrey Way

Hi, I'm Jeffrey. I'm the creator of Laracasts and spend most of my days building the site and thinking of new ways to teach confusing concepts. I live in Orlando, Florida with my wife and two kids.

    Step one for any new editor is to configure the layout and theme. While Visual Studio Code's presentation out of the box is surprisingly good, let's tweak things a bit to my personal taste level.

  1. A clean workflow for manipulating files is essential. In this episode, you'll learn how to optimize the process of creating, deleting, renaming, and duplicating your files.

  2. Let's next review the process of traversing your file system. Or, in other words, what is the fastest way to open a file, or a class, or a PHP method. It's vital that we streamline this workflow as best as we can.

  3. The programming world splits into two groups: those who research Vim keybindings for each new editor they try, and those who are still figuring out how to exit Vim. If you're among the former, let's get these keybindings working.

  4. Please don't manually type out your various class and method structures. These are perfect use-cases for custom snippets. Let's create a few together, while reviewing some key variable names to make them more dynamic.

  5. If you're accustomed to opening a separate Terminal or iTerm window each time you need to trigger a console command, if you wish, you may now accomplish this directly from Visual Studio Code, via its terminal panel. Ctrl-` is your friend.

  6. Visual Studio Code provides first-class Git support out of the box. Let's take a look.

  7. For the Laravel users among you, the Artisan extension allows you to trigger any artisan command straight for the GUI. This means, within seconds, you can generate and load your new controller.

  8. Let's review some key PHP workflow techniques in this episode. What's the quickest way to import a class? Or how can we shorten fully qualified class names in less than a second?

  9. Built by Caleb Porzio, the 'Better PHPUnit' extension offers us an incredibly clean workflow for building test-driven applications.

  10. Ideally, each time I save a PHP file, it should apply PSR-2 formatting, as well any number of automatic code fixes that I desire. Let's learn how to accomplish that very thing in this episode. You'll love it!

  11. We're getting nitpicky at this point, but that's okay. Having to reach for the mouse to right-click on a symbol to perform any kind of contextual action is a bit annoying. Let's instead assign a custom keyboard shortcut so that my hands can remain on the keyboard permanently.

  12. It's always a little tricky to setup a good PHP debugging workflow in your editor. Luckily, Jose Soto has documented the setup process for us. Yay! Now, we can follow a few quick steps to arrange for powerful PHP debugging in Visual Studio Code.

  13. How did we get along so long before the wonder of multiple cursors? We'll never know. If this concept is new to you, you're in for a productivity treat.

  14. Before moving on to various JavaScript conveniences and optimizations for Visual Studio Code, let's do a full PHP recap and review.

  15. The useful 'Import Cost' extension allows us to automatically visualize the size of each JavaScript dependency we import. It does this by appending a small, non-intrusive label next to each import. Are you importing a massive dependency that you didn't know about? Well, if you are, this extension will make it crystal clear.

  16. Let's supercharge our JavaScript (including Vue templates) error and style guide detection with ESLint. Once installed, you'll stop and wonder how you were able to code effectively before this wonderful addition to your tool belt.

  17. What if we could add a single commented line to the top of any vanilla JavaScript file, and instantly activate advanced TypeScript type checking and error reporting? How cool would that be? Well - as it turns out, we can!

The most concise screencasts for the working developer, updated daily.

There's no shortage of content at Laracasts. In fact, you could watch nonstopfor days upon days, and still not see everything!

Are you switching from PHP Storm, Web Storm or Sublime? I personally love JetBrains’ IDEs and of course Sublime is amazing. I used both of them for many years now. But when ever I go online I look at people’s working on Visual Studio Code everywhere. I see people who make tutorials are using Visual Studios Code. I said to myself I have to give it a try. So I downloaded Visual Studio Code.

Oh Man! It’s fast, if you don’t have it already, click here to get it.

Now I can only keep using it, if it’s adding value, plus it can do all of the things what PHP storm used to do. Turns out installing Visual Studios Code is not everything. We also need to install extensions which can do functions what we want. So let’s look at some extensions for Laravel which can make our life easier.

Key bindings

As we also use shortcuts for everything. We try to make less use of our mouse. Now Visual Studios Code comes with it’s own keybinding. You can can go to Preferences > Keyboard Shortcuts to see all key bindings. You can learn them again or you can double click on any shortcut and assign it a new one. But it’s time consuming and uncool. Luckily we have extension for this.

IntelliJ IDEA Keybindings

Install this if you are coming from Intellij’ IDEs.

Sublime Text Keymap and Settings Importer

Install this if you are coming from Sublime

By installing them, it will change all of your keyboard shortcuts to one’s, you used to use in other IDE.

PHP Intelephense

Wonderfull Extension to provide developers with essential functionality that makes coding enjoyable and productive.

Laravel Artisan

Another Productive Extension to run Laravel Artisan commands from within Visual Studio Code. You can use command palette to run php artisan commands, by default keyboard shortcut is cmd+shift+P on Mac or ctrl+shift+P on Windows.

Laravel 5 Snippets

I personally like this extension a lot. As it let us add Snippets of Laravel quickly. As you start type, it will start showing you suggestions.

Laravel Blade Snippets

Snippets for Laravel Blade.

Snippet Creator

IDEs like PHPStorm have some snippets built in and if you want to use them here in Visual Studio Code as well. Install this extension as it lets you create your own snippets in few seconds. One of the snippet I personally like is how we can just time pubf and press TAB and IDE will automatically convert it to:

PHP Namespace Resolver

Most of the errors of imports, will be taken care by extension we installed previously PHP Intelephense. But sometimes some import missing and we can either type it manually or we can use this extension to import the PHP file for us quickly.

Bonus

Material Theme

Visual Studio Code by default comes with beautiful design. But this extension can make it more minimal. I personally like Material Theme High Contrast version.

As a developer, my code editor is my most important tool. I wanted to make it productive as possible. If you know any extension which adds value and I missed it, please leave a comment below or ping me on Twitter.

Visual Studio Code Laravel Autocomplete

Resources:

Visual Studio Code Laravel Plugin

Download Visual Studio Code
Laracasts – Visual Studio Code for PHP Developers