title: WordPress post article on Laravel blade page
body: <p>I tried to reach this site <a href="http://grossi.io/2014/working-with-laravel-4-and-wordpress-together/" rel="nofollow">Working laravel 4 and 5 and WordPress together</a>, however there is one more thing I utterly don't get on my blade page. I would like to post my articles from my blog on my Laravel page, working with "foreach" and standard WordPress syntax. Still I get an error. Here's my code.</p>
  
  <p><em>I follow this from the site.</em></p>
  
  <pre><code>class CreicController extends BaseController {
  
    public function index() 
    {
      $query = new WP_Query(array(
        'post_type' =&gt; 'posts',
        'post_per_page' =&gt; 4,
        'order' =&gt; DESC,
      ));
  
      $posts = $query-&gt;get_posts();
  
      return View::make('layouts.creic')-&gt;with('posts', $posts);
    }
  
  }
  </code></pre>
  
  <p>and I would like to use foreach to my blade page then i get lost (i tried to copy and do something in php but no luck).</p>
  
  <p>Here's my old PHP before Laravel</p>
  
  <pre><code>&lt;!-- Start Articles --&gt;
  &lt;?php
    $posts = get_posts('numberposts=4&amp;order=desc');
    foreach ($posts as $post) : setup_postdata( $post );
  ?&gt;
  &lt;artcile class="col-xs-12 col-sm-12 col-md-6 article-section"&gt;
    &lt;div class="media"&gt;
      &lt;div class="media-left"&gt;
        &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;
          &lt;?php the_post_thumbnail( array(80,80, true) ); ?&gt;
        &lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="media-body"&gt;
        &lt;h4 class="media-heading"&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h4&gt;
        &lt;time datetime="2015-2-23T01:30:08Z" title="February 23, 2015" class="timeago"&gt;&lt;/time&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/artcile&gt;
  &lt;?php endforeach; ?&gt;
  &lt;!-- End Articles --&gt;
  </code></pre>