Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amir9480/vscode-laravel-extra-intellisense
This extension adds extra autocompletion for laravel projects to VSCode.
https://github.com/amir9480/vscode-laravel-extra-intellisense
autocomplete intellisense laravel vscode vscode-extension vscode-for-laravel
Last synced: 3 days ago
JSON representation
This extension adds extra autocompletion for laravel projects to VSCode.
- Host: GitHub
- URL: https://github.com/amir9480/vscode-laravel-extra-intellisense
- Owner: amir9480
- License: mit
- Created: 2019-01-06T18:50:15.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-01-13T19:55:02.000Z (19 days ago)
- Last Synced: 2025-01-15T21:10:52.114Z (17 days ago)
- Topics: autocomplete, intellisense, laravel, vscode, vscode-extension, vscode-for-laravel
- Language: TypeScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=amiralizadeh9480.laravel-extra-intellisense
- Size: 3.06 MB
- Stars: 3,661
- Watchers: 18
- Forks: 55
- Open Issues: 36
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Laravel Extra Intellisense
This extension provides [Laravel](https://laravel.com/) routes, views and ... autocomplete for [VSCode](https://code.visualstudio.com/).
Please read the [security note](#security-note) and [how to configure](#sample-config-to-use-docker) before using the extension.
## Autocomplete
* [Route names and route parameters](#route-names-and-route-parameters)
* [Views and variables](#views-and-variables)
* [Configs](#configs)
* [Translations and translation parameters](#translations-and-translation-parameters)
* [Laravel mix and vite functions](#laravel-mix-and-vite-functions)
* [Validation rules](#validation-rules)
* [View sections and stacks](#view-sections-and-stacks)
* [Env](#env)
* [Route Middlewares](#route-middlewares)
* Asset
* Model Attributes (Beta!)
* Blade directives### Route names and route parameters
![Routes](./images/screenshot-route.gif)
### Views and variables
![Views](./images/screenshot-view.gif)
### Configs
![Configs](./images/screenshot-config.gif)
### Translations and translation parameters
![Translations](./images/screenshot-trans.gif)
### Laravel mix and vite functions
![Mix](./images/screenshot-mix.gif)
### Validation rules
![Validation rules](./images/screenshot-validation.gif)
### View sections and stacks
![View sections](./images/screenshot-section.gif)
### Env
![env](./images/screenshot-env.gif)
### Route Middlewares
![Middlewares](./images/screenshot-middleware.gif)## Configuration
### LaravelExtraIntellisense.customValidationRules:
Your custom validation rules snippets.Example:
```json
"LaravelExtraIntellisense.customValidationRules": {
"mobile": "mobile",
"distance_gt": "distance_gt:${0:1km}"
}
```### LaravelExtraIntellisense.phpCommand
Command to run PHP codes to interact with your Laravel application.Default:
`php -r \"{code}\"`
> Note: {code} is PHP code generated by extension and should be wrapped with "".### LaravelExtraIntellisense.basePath
Base path of your Laravel application. useful if your Laravel project is not at the root of you project directory.
> If the base path starts with `.` (like `./src`) it will be considered a relative path otherwise it will be considered an absolute path.### LaravelExtraIntellisense.basePathForCode
Same as `LaravelExtraIntellisense.basePath` but this one using for `require_once` in generated PHP codes.### LaravelExtraIntellisense.viewDirectorySeparator
You also can use `/` instead of `.` as directory separator for view autocomplete.### LaravelExtraIntellisense.modelsPaths
Array of paths including your models. (Default: `["app", "app/Models"]`)### LaravelExtraIntellisense.modelVariables
Variable names that should provide autocomplete with specific model class. Finding variable type (especially in views) is not easy so you need to manually define variable types.Example: The Following setting provides auto completion each time you type `discountedProduct->` with `App\Models\Product` model attributes.
```json
"LaravelExtraIntellisense.modelVariables": {
"discountedProduct": "App\\Models\\Product"
}
```
> All `camelCase` and `snake_case` of model names provide autocomplete by default.
> For example `productDiscount` and `product_discount` provides member autocomplete from `App\Models\ProductDiscount` model.### LaravelExtraIntellisense.modelAttributeCase
Change model attribute names case to `snake_case`, `camelCase` or `default`. (Default = `default`)### LaravelExtraIntellisense.modelAccessorCase
Change model accessor names case to `snake_case`, `camelCase` or `default`. (Default = `snake`)### LaravelExtraIntellisense.disableBlade
If you want to disable blade directives autocomplete set this to true.### LaravelExtraIntellisense.disableAuth
If you want to disable authorization autocomplete set this to true### LaravelExtraIntellisense.disableErrorAlert
Hide error alerts when extension can't get data from your application.#### Sample config to use docker
This is a simple configuration to use via [Laradock](https://github.com/laradock/laradock).```json
"LaravelExtraIntellisense.phpCommand": "docker exec -w /var/www/your-project -u laradock laradock_workspace_1 php -r \"{code}\"",
"LaravelExtraIntellisense.basePathForCode": "/var/www/your-project"
```Another sample for [Laravel Sail](https://laravel.com/docs/sail).
```json
"LaravelExtraIntellisense.basePathForCode": "/var/www/html",
"LaravelExtraIntellisense.phpCommand": "docker-compose exec -w /var/www/html YOUR_SERVICE_NAME php -r \"{code}\""
```
Default YOUR_SERVICE_NAME for Laravel sail is `laravel.test`.It is possible to use this extension with other docker images or even other virtual machines.
## Security Note
This extension runs your Laravel application automatically and periodically to get the information needed to provide autocomplete.So if you have any unknown errors in your log make sure the extension not causing it.
Also if you writing any sensitive code in your service providers, disable the extension temporarily to prevent unwanted application executing.
## Release Notes
### 0.6.x
* Add blade directives autocomplete (#45).
* Add change case option for model attributes (#46).
* Add support workspace with multiple directory (#54).
* Add nested translations support (#54).
* Add Vite autocompletion support (#131)### 0.5.x
* Add `asset` support.
* Add Model attributes autocomplete (Beta).### 0.4.x
* Add Docker support.### 0.3.x
* `env` autocomplete added.
* Route `middleware` autocomplete added.
* Nested stack and section support added.
* Function parser improvement.
* Performance improvement.
* Bug fixes (#25, #26)
* Add configuration for views separator (#22).
* `can`, `cannot` autocomplete.
* Fix #18.### 0.2.x
* Validation rules autocomplete added.
* works with `Validator` class, `validate` functions and inside request classes.
* `markdown` function added to view functions for autocomplete.
* Using file watcher instead of save event. Better change detect for view autocomplete.
* json translation autocomplete added.
* Auto-Retry removed from all providers. causes some performance issues.
* Disable logging added.
* View parameters autocomplete.
* Route autocomplete bug in linux fixed.
* Blade section autocomplete added.
* Blade stack autocomplete added.
* Duplicate section autocomplete items fixed.
* PHP commands converted to async functions to prevent unresponsive extension host error.### 0.1.x
* Fix problems with linux.
* Add translation autocomplete.
* Improved providers.
* Add mix autocomplete.
* Performance improvments.
* Route action autocomplete added. `Route::get`, *`Route::post`, ... autocompletes controller actions inside app\Http\Controllers.### 0.0.x
* Config autocomplete added.
* Route bug fix.
* View names with namespaces ready to use.
* View functions autocomplete added.
* Blade bug fix.
* Add route autocomplete.## Recommended extensions
* [PHP Intelephense](https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client)
* [PHPCS](https://marketplace.visualstudio.com/items?itemName=ikappas.phpcs)
* [PHP DocBlocker](https://marketplace.visualstudio.com/items?itemName=neilbrayfield.php-docblocker)
* [PHP formatter](https://marketplace.visualstudio.com/items?itemName=kokororin.vscode-phpfmt)
* [Laravel Blade Snippets](https://marketplace.visualstudio.com/items?itemName=onecentlin.laravel-blade)
* [Laravel goto view](https://marketplace.visualstudio.com/items?itemName=codingyu.laravel-goto-view)
* [Laravel goto controller](https://marketplace.visualstudio.com/items?itemName=stef-k.laravel-goto-controller)
* [DevDb](https://marketplace.visualstudio.com/items?itemName=damms005.devdb)## Credits
* [PHP parser](https://github.com/glayzzle/php-parser)