title: laravel 5.6 query builder where orWhere not working
body: <p>I have a page where both live and past papers should be shown but when the live paper time expires the live papers should not be loaded and only the past paper should be shown based on the time.
  the query currently used,</p>
  
  <pre><code>$curdate=Carbon::now();
  $papers = DB::table('papers')
          -&gt;join('payments','papers.id','=','payments.paper_id')
          -&gt;join('tutors','papers.tutor_id','tutors.id')
          -&gt;select('papers.*','tutors.name')
          -&gt;where('papers.id','payments.paper_id')
          -&gt;where('papers.type','=','Normal')
          -&gt;orWhere('papers.live_end_time', '&gt;=' ,$curdate)
          -&gt;where('payments.user_id',$id)
          -&gt;get();
  </code></pre>
  
  <p>This shows the live papers but not the past papers. And when the time expires the live papers are hidden. when i changed places of the <code>where</code> and <code>orWhere</code> clauses the past papers are shown but not the live papers why is this happening and is their a fix.</p>