How to auto import laravel class in vs code

Viewed 44781

I am currently working on laravel project in visual studio code text editor. If i use laravel package classes in the code at that time i want to automatically import that class using any vs code extension. If you know any best extension for this let me know.

For example I am using Schema class in the code then class should automatically imported like use use Illuminate\Support\Facades\Schema;

4 Answers

Use PHP Intelephense extension by Ben Mewburn for auto importing class name and many more feature. Install from vs code editor or check it here

PHP Namespace Resolver extension for VSCode works fine for me.

PHP Intelephense is the best extension for auto import class.

consider checking this out too: https://github.com/phpactor/vscode-phpactor

I use phpactor in my day to day, code intellissense, auto imports, refactoring tools like renaming classes and thus its references, navigation options (ie, move from source to test, mother or whatever), etc

Related