I want PHPdoc blocks were considered within 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 variants:
{{
/**
* @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 the autocomplete worked in all blocks for blade templates?
More or less same answer, just wrapped in a blade directive:
@php /** @var App\Models\User $user */ @endphp
{{ $user->email }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With