title: laravel foreach loop in controller
body: <p>i have a problem about looping data in controller (laravel 4). my code is like this:</p>
  
  <pre><code>$owner = Input::get('owner');
  $count = Input::get('count');
  $product = Product::whereOwnerAndStatus($owner, 0)-&gt;take($count)-&gt;get();
  </code></pre>
  
  <p>when i want to use foreach to loop for $product result with code like this:</p>
  
  <pre><code>foreach ($product-&gt;sku as $sku) {
      // Code Here
  }
  </code></pre>
  
  <p>the result is returning error
  <strong>Undefined property: Illuminate\Database\Eloquent\Collection::$sku</strong></p>
  
  <p>so, i try to improvise a little with this code:</p>
  
  <pre><code>foreach ($product as $items) {
      foreach ($items-&gt;sku as $sku) {
          // Code Here        
      }
  }
  </code></pre>
  
  <p>the code returning error like this:
  <strong>Invalid argument supplied for foreach()</strong> </p>
  
  <p>is there someone who could help me solve this?</p>