title: Call to a member function isEmpty() on a non-object?
body: <p>I make my view in the controller via:</p>
  
  <pre><code>$data = Lib::index();
      $view = View::make('index')
          -&gt;with('data', $data)
          -&gt;render();
      return $view;
  </code></pre>
  
  <p>I can check if data is empty in the controller via:</p>
  
  <pre><code>$data-&gt;isEmpty();
  </code></pre>
  
  <p>But when I try the same thing in the view I get the error:</p>
  
  <pre><code>Call to a member function isEmpty() on a non-object
  </code></pre>
  
  <p>Why?</p>
  
  <p>Here's the code for Lib::index():</p>
  
  <pre><code>   $page = isset($_GET['page']) ? ($_GET['page']) : 1;
  
      Paginator::setCurrentPage($page);
  
      try {
          $data = Asset::with(array('sizes'=&gt; function($query){
              $query-&gt;select('width', 'height', 'asset_id');
          }))-&gt;where('active', 1)-&gt;orderBy('updated_at', 'DESC')-&gt;paginate(Config::get('p.results_per_page'), array('id', 'alt'));
      }
  
      catch (QueryException $e) {
  
          App::abort(404);
      }
  
  
      return $data;
  </code></pre>