Laravel Distinct Count : <p>Any way to make this query work using laravel? DB::raw or Eloquent usage doesn't matter.</p>

<pre><code>SELECT count(DISTINCT name) FROM tablename;
</code></pre>

<p>Here's what i've tried but cannot get the proper output:</p>

<pre><code>EloquentTableName::select(DB::raw('count(DISTINCT name) as name_count'))-&gt;get();
</code></pre>

<p>This returns something like this and i'd like to fix that:</p>

<pre><code>([{"name_count":"15"}])
</code></pre>

<p>I just want to get count 15.</p>
