I want PHPdoc blocks were considered within the blade template.
PhpStorm 9, Laravel 5.1, blade template file:
More or less same answer, just wrapped in a blade directive:
@php /** @var App\Models\User $user */ @endphp
{{ $user->email }}
ATM PhpStorm does not support PHPDoc comments in blade templates using blade syntax (especially for completing blade variables).
Please follow these tickets (star/vote/comment) to get notified on progress:
You can now do it like you wanted:
<?php
/* @var App\Models\User $user */
?>
...
{{ $user->email }} <- autocomplete working
see https://blog.jetbrains.com/phpstorm/2017/02/code-completion-in-laravel-blade-templates/
As of right now this isn't entirely possible due to PHPStorm's lack of support for Blade templates.
This package may be of some use for other Laravel related issues https://github.com/barryvdh/laravel-ide-helper