title: undefined variable when i called it on a header view in laravel
body: <p>My route is:</p>
  
  <pre class="lang-php prettyprint-override"><code>Route::get('header','HomeController@header')-&gt;name('header');
  </code></pre>
  
  <p>My functionality is:</p>
  
  <pre class="lang-php prettyprint-override"><code>public function header()
  {
      $header=ParentCategory::latest()-&gt;get();
      return view('includes.header',compact('header'));
  }
  </code></pre>
  
  <p>My view foreach loop is here:</p>
  
  <pre class="lang-php prettyprint-override"><code>@foreach($header as $pc)
      &lt;li class=" aligned-left parent dropdown " &gt;
      &lt;a href="index7fa3.html?route=product/category&amp;amp;path=18"
          class="dropdown-toggle" data-toggle="dropdown"&gt;
          &lt;span class="menu-title"&gt;{{$pc-&gt;name}}&lt;/span&gt;&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;      
  @endforeach
  </code></pre>
  
  <p>I don't want to write their route which name is header, mention in browser I want to work my foreach loop without route name, header.</p>