How to do IS NOT NULL in a Laravel query
<p>I'm trying to do this SQL statement and outputting it using the blade engine:</p>

<pre><code>" SELECT SUM(like) FROM likes WHERE post_id = ". $post-&gt;id. " AND source_id IS NOT '' "
</code></pre>

<p>I don't know how to do it, I tried this yesterday but it didn't work:</p>

<pre><code>{{$post-&gt;likes-&gt;where('post_id', $post-&gt;id)-&gt;where('source_id', '&lt;&gt;', '')-&gt;sum('like')}}
</code></pre>

<p>The <em>likes</em> table "belongsTo" both the <em>sources</em> table and the <em>posts</em> table.</p>

<p><strong>Edit:</strong></p>

<p>I'm using Laravel version <strong>5.2.45</strong></p>