title: Undefined class Route in app.blade.php laravel
body: <p>When I try to access <code>Route::has()</code> from a view I get <code>"Undefined class 'Route'".</code>
  I don't get this error when I access  this class from <code>routes/web.php</code></p>
  
  <p>All these files are automatically generated by Laravel.
  I'm using phpStorm.</p>
  
  <p>how can I solve it?</p>
  
  <p>thanks</p>
  
  <p>app.blade.php:</p>
  
  <pre><code>@if (Route::has('login'))
       &lt;li class="nav-item"&gt;
            &lt;a class="nav-link" href="{{ route('register') }}"&gt;{{ __('Register') }}&lt;/a&gt;
       &lt;/li&gt;
  @endif
  </code></pre>
  
  <p>home.blade.php:</p>
  
  <pre><code>@extends('layouts.app')
  
  @section('content')
    &lt;div id="result"&gt;&lt;/div&gt;
  @endsection
  </code></pre>
  
  <p>routes/web.php:</p>
  
  <pre><code>&lt;?php
  use Illuminate\Support\Facades\Auth;
  use Illuminate\Support\Facades\Route;
  
  Route::get('/', function () {
    if(Auth::check())
      return view('home');
    else
      return redirect()-&gt;route('login');
  });
  
  Auth::routes(["reset"=&gt;false]);
  
  Route::get('/home', 'HomeController@index')-&gt;name('home');
  </code></pre>
  
  <p>routes/api.php:</p>
  
  <pre><code>&lt;?php
    use Illuminate\Http\Request;
    use Illuminate\Support\Facades\Route;
  
    Route::middleware('auth:api')-&gt;get('/user', function (Request $request) {
      return $request-&gt;user();
     });
  </code></pre>