How to get PhpStorm to autocomplete facades in blade-files

Viewed 1808

When using @if (Auth::check()), PhpStorm doesn't recognize the Auth.

How do I tell PhpStorm that Auth is \Illuminate\Support\Facades\Auth?

Tested:

@php
use Illuminate\Support\Facades\Auth;
/** @var \Illuminate\Support\Facades\Auth Auth */
class Auth extends \Illuminate\Support\Facades\Auth {}
@endphp

@use(\Illuminate\Support\Facades\Auth)

neither worked, still get "Undefined Class Auth"

Edit 1:

the class Auth extends \Illuminate\Support\Facades\Auth {} line works if it's in another file, for example, the "_ide_helper.php", having it inside the blade file doesn't work.

2 Answers
Related