title: Laravel Eloquent add 'where' clause in the query by condition
body: <p>I want to add a condition first before adding another <code>where</code> query it but seems that laravel won't allow. I want something like the following.</p>
  
  <pre><code>function index()
  {
      $role = Auth::user()-&gt;role; //SEE_ALL, SEE_DEPT_A, SEE_DEPT_B
  
      $q = Input::get('q');
      if ($q != "") {
          $user = User::where('name', 'LIKE', '%' . $q . '%')
              -&gt;orWhere('email', 'LIKE', '%' . $q . '%')
              -&gt;orderBy('name');
  
          if ($role == "SEE_DEPT_A") {
              $user-&gt;where('user_department', "A");
          }
  
          $user-&gt;paginate(10)-&gt;appends('q', $q);
      }
  
      return view('users.index')-&gt;with('data', ['users' =&gt; $user, 'q' =&gt; $q]);
  }
  </code></pre>