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.
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!