title: Call to a member function increment() on null
body: <p>everything work fine when i call post use $id,
  since i change to $slug, it show error </p>
  
  <blockquote>
    <p>Symfony \ Component \ Debug \ Exception \ FatalThrowableError
    (E_ERROR) Call to a member function increment() on null</p>
  </blockquote>
  
  <p>my controller after i change $id to slug</p>
  
  <pre><code>public function showpost($slug)
  {
      $post = Post::published()
      -&gt;where('slug', '=', $slug)-&gt;first();
  
      $post-&gt;increment('view_count');
  
      return view("blog.showpost", compact('post'));
  }
  </code></pre>
  
  <p>here is blade file</p>
  
  <pre><code>&lt;div class="block-heading-1"&gt;
     &lt;span class="text-muted mb-3 mt-5"&gt;
          &lt;i class="fa fa-clock-o fa-lg"&gt;&lt;/i&gt;&amp;nbsp{{ $post-&gt;date }}
          &lt;i class="fa fa-eye fa-lg"&gt;&lt;/i&gt;{{ $post-&gt;view_count }}
          &lt;i class="fa fa-comments-o fa-lg"&gt;&lt;/i&gt;&amp;nbsp{{ $post-&gt;comments-&gt;count() }}
     &lt;/span&gt;
          &lt;h1 class="mb-4" style="font-size: 20px; padding-top: 15px; margin-bottom: 0px; pad"&gt; 
              {{ $post-&gt;title }}
         &lt;/h1&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>how to fix it?</p>