title: Get user info from another table in laravel
body: <p>I have <code>Order</code> table where user orders will be stored with their <code>id</code> and also have status of <code>0 / 1</code> to show if that order is paid by user or no.</p>
  
  <p>Now I want to show in their profile that for example they have 10 orders and 3 paid.</p>
  
  <p>I can get that number of total orders which is 10 but i have problem with getting the number of those 3 orders that has been paid.</p>
  
  <p>Currently I have this:</p>
  
  <pre><code>$ordersd = DB::table('orders')-&gt;where('status', Auth::user()-&gt;username)-&gt;pluck('status')-&gt;count();
  </code></pre>
  
  <p>But it is not what I need cause I need to specified that <code>count</code> for me only orders with status <code>1</code> which belongs to logged user.</p>
  
  <p>How do I do that?</p>
  
  <p>Thanks.</p>