Home > PHP Framework > Laravel > Laravel syntax prompt plugin in VSCode

Laravel syntax prompt plugin in VSCode

Guanhui
Release: 2020-06-16 18:03:32
forward
5986 people have browsed it

Laravel syntax prompt plugin in VSCode

Laravel Intellisense is a Visual Studio Code plug-in contributed by Mohamed Benhida that provides some nice auto-completion features for things like Eloquent models, factories, configurations, and API resources.

What I like about this plug-in is that it supports config(), view() and other Laravel syntaxes. These syntaxes Autocompletion is generally not available in most editors, but can save a lot of time context switching between databases and code.

This is the complete feature list:

  • Resource resource auto-completion

  • Eloquent model auto-completion

  • Factory auto-completion

  • View attempts auto-completion

  • Config configuration auto-completion

  • Route route auto-completion

The advantage of this plug-in is that it can provide unique help to Laravel developers: editor help around model data. The plugin provides autocomplete functionality by using the application's database connection to obtain model properties.

For example, suppose you need to write a factory for a newly created model. In the current version of Laravel, you need to reference the database fields in your migration class, database table, or PHPDoc field name to see what fields are available.

If Visual Studio Code isn't right for you, Blueprint may satisfy this need for automation by generating various files from a centralized configuration file. You can also benefit from using Blueprint and Laravel Intellisense together, I just want to point out that there are multiple ways to manage the common parts of the files and the code around the application data.

Another solution might be the Laravel Populated Factory plugin, but this is only useful for factories.

I usually manage a list of @property-read values ​​in an annotation on the model class (which serves as a useful reference and autocomplete for model properties), but this breaks down when trying to fill in the factory The autocomplete feature doesn't help.

Auto-completion of View views is another added benefit, it saves you from constantly looking for files manually:

PhpStorm does not use {{view ()}} Accessibility provides autocomplete, but it does support @include directives in Blade files for autocomplete.

Learn more

You can download this plug-in by searching for laravel intellisense in Visual Studio's plug-in market. The source code is available on GitHub at simoebenhida/laravel-intellisense.

Recommended tutorial: "Laravel Tutorial"

The above is the detailed content of Laravel syntax prompt plugin in VSCode. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:learnku.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template