title: Laravel Eloquent: How to form "2 Select database" to peform count?
body: <p>I will ask you.
  in sql i have a code like this ?</p>
  <pre class="lang-php prettyprint-override"><code>    SELECT keterangan_warga, COUNT(keterangan_warga) as cnt 
      FROM ( SELECT distinct nokk_warga, keterangan_warga FROM `warga` ) as t
      GROUP by keterangan_warga;
  </code></pre>
  <p>then , i will perform this to Laravels. How can I do? Thanks, I try to 2 select but it error.</p>
  <p>i will perform this data t laravels like this
  <img src="https://i.stack.imgur.com/zUqdg.png" alt="" />
  and I try to implement in laravels there is error intelephense in the second <strong>select</strong> and second <strong>from</strong></p>
  <pre class="lang-php prettyprint-override"><code>$data = DB::selectRaw('keterangan_warga , count(keterangan_warga ) as JumlahWarga')
      -&gt;from( select('nokk_warga', 'keterangan_warga')-&gt;distinct()-&gt;from('warga'))
      -&gt;groupby('keterangan_warga')
      -&gt;get();
  </code></pre>
  <p>The table name is warga, and this is the table.
  <a href="https://i.stack.imgur.com/L6E6e.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>I will count keterangan_warga based on nokk_warga, i already successfully show the data that I need in sql but I dont know how to perform it in laravales.
  Do you have any suggestion?</p>