title: Undefined variable when trying to pass data to the view - Laravel 5
body: <p>I'm trying to include a view on all of my pages (code is below), so I've included it within my layout template (so it renders on everything). Unfortunately, when I try and run any page - this error occurs:</p>
  
  <blockquote>
    <p>Undefined variable: sites (View:
    /Users/Documents/audit/resources/views/layouts/check.blade.php)</p>
  </blockquote>
  
  <p><strong>View (check.blade.php):</strong></p>
  
  <pre><code>@if (count($sites) == 0)
   // Removed as it is irrelevant.
  @endif
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>public function siteCheck()
  {
    return View::make('layouts.check')
                    -&gt;with('sites', Site::where('user_id', Auth::id())
                    -&gt;get());
  }
  </code></pre>
  
  <p><strong>Where I try and include the view (which shows the error):</strong></p>
  
  <pre><code>@if(!Auth::guest())
    @include('layouts.check')
  @endif
  </code></pre>
  
  <p>N.B. I haven't added any code relating to the layouts.check page within the routes.</p>
  
  <p>Many thanks for your help.</p>