How can I make variables autocomplete in PhpStorm 9 templates for Blade?

I want the PHPdoc blocks to be considered in the blade template.

PhpStorm 9, Laravel 5.1, blade template file:

<?php /* @var App\Models\User $user */ ?> ... <?= $user->email ?> <- autocomplete for the word "email" is working ... {{ $user->email }} <- autocomplete not working 

I tried different options:

 {{ /** * @var App\Models\User $user **/ }} {{ /* @var App\Models\User $user */ }} ... {{ $user->email }} <- autocomplete not working... ... In such variant autocomplete works, but only within that block: {{ /* @var App\Models\User $user */ $user->email }} ... {{ $user->email }} <- here does not work again... 

How to make autocomplete processed in all blocks for click templates?

+8
php phpstorm laravel blade phpdoc
source share
2 answers

ATM PhpStorm does not support PHPDoc comments in blade templates using blade module syntax (especially for completing blade variables).

Please follow these tickets (star / voice / comment) to receive progress notification:

+3
source share

This is currently not entirely possible due to the lack of PHPStorm support for Blade templates.

This package may be useful for other Laravel related issues https://github.com/barryvdh/laravel-ide-helper

+1
source share

All Articles