title: Laravel compact is not working
body: <p>I'm trying to make a posting system, with a resource routing combination on the posts. When I try to run the app to view the posts, it returns an error stating that the posts could not be found within the view. I have the controller code for the index and the show functions: </p>
  
  <pre><code>public function index()
  {
      $posts = Post::latest()-&gt;get();
  
      return view('view', compact('posts'));
  }
  
  public function show(Post $post)
  {
      return view('posts.show', compact('post'));
  }
  </code></pre>
  
  <p>The view that I have for the app uses the post variable to display the posts: </p>
  
  <pre><code>&lt;div class="container"&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-md-6 col-md-offset-2"&gt;
                  &lt;div class="panel panel-default"&gt;
                      &lt;!-- Posts will be displayed on the same panel --&gt;
                      &lt;div class="panel-body" id="view"&gt;
                          @foreach($posts as $post)
                              &lt;article id="post"&gt;
                                  &lt;a href="/view/posts{{ $post-&gt;id }}"&gt;
                                      {{ $post-&gt;title }}
                                  &lt;/a&gt;
  
                                  &lt;div class="body"&gt;
                                      {{ $post-&gt;body }}
                                  &lt;/div&gt;
  
                                  &lt;!-- Footer for posts will include interaction features --&gt;
                              &lt;/article&gt;
                          @endforeach
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Is there something that the laravel installation isn't doing correctly? Is the compact function set up correctly? </p>