title: How to add view count for post in laravel
body: <p>I am performing a Blog application using laravel.. I want to track the count of the post view whenever a user view a particular blog post it should increment only once whether it is a registered user or non-registered users. ... And also want to display the most viewed blogs according to the view count.. Can anyone assist with the logic.</p>
  <pre><code>/ Table
  Schema::create('posts', function(Blueprint $table)
  {
      $table-&gt;increments('id');
      $table-&gt;text('body')
      $table-&gt;integer('count');
      ...
      $table-&gt;timestamps();
  });
  
  
  
  public function show($id) 
  {
      $post = Post::find($id);
  
      Post::update([
          'count' =&gt; $post-&gt;count + 1
      ]);
  
  
      return View::make('posts', compact('post'));
  }
  </code></pre>