• Stars
    star
    2,588
  • Rank 17,700 (Top 0.4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This extension adds extra autocompletion for laravel projects to VSCode.

Laravel Extra Intellisense

This extension provides Laravel routes, views and ... autocomplete for VSCode.

Autocomplete

Route names and route parameters

Routes

Views and variables

Views

Configs

Configs

Translations and translation parameters

Translations

Laravel mix function

Mix

Validation rules

Validation rules

View sections and stacks

View sections

Env

env

Route Middlewares

Middlewares

Configuration

LaravelExtraIntellisense.customValidationRules:

Your custom validation rules snippets.

Example:

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

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.

"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

Sample config to use docker

This is a simple configuration to use via Laradock.

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

"LaravelExtraIntellisense.basePathForCode": "/var/www/html",
"LaravelExtraIntellisense.phpCommand": "docker-compose exec -w /var/www/html YOUR_SERVICE_NAME php -r \"{code}\""

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

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 autocompelete added.
  • Blade bug fix.
  • Add route autocomplete.

Donation

Recommended extensions

Credits

More Repositories

1

vscode-cpp-helper

vscode extension to create implementation for c++ function prototypes.
TypeScript
256
star
2

instagram-hide-all

A command-line tool to temporary hide/unhide Instagram stories from all of your followers
Python
11
star
3

amir9480

10
star
4

vscode-flutter-widget-wrap

Wrap flutter codes inside Container/Stack.
TypeScript
9
star
5

laravel-auto-update

Laravel automatic user friendly update package.
PHP
8
star
6

laravel-vue-crud-example

SPA CRUD Example with Laravel and Vue.
PHP
8
star
7

laravel-url-shortener-sample

Laravel Url shortener sample.
PHP
7
star
8

signalpp

signal++ is an easy to use signal/slot library for c++
C++
7
star
9

amir9480.github.io

personal github pages :)
Vue
5
star
10

laravel-sanjab-tutorial-sample

Sanjab sample created for tutorial
PHP
5
star
11

Qt-Countries-Sample

Just another program with Qt just for hobby
QML
5
star
12

laravel-jquery-file-upload-example

File upload example with https://github.com/blueimp/jQuery-File-Upload/ in laravel php framework
PHP
4
star
13

laravel-dropzone-example

this is drop zone upload example for my personal usage
PHP
4
star
14

simple-Qt-phoneBook

C++
4
star
15

michka

My personal project to make my path to my dreams
C++
4
star
16

Traffic-booster

a website traffic booster just for learning . ( laravel / jquery / bootstrap )
PHP
4
star
17

laravel-js-localization-example

PHP
3
star
18

laravel-sanjab-cafe-sample

A cafe project created with sanjab.
PHP
3
star
19

azdb

Yet another personal project
PHP
2
star
20

lightning

Just for archiving my old codes & bugs
C++
2
star
21

laravel-livewire-upload-sample

PHP
1
star
22

learning-opengl

Just for archive my code
C++
1
star