title: Multiple queries in laravel scope function
body: <p>I am attempting to make multiple queries in a scope function in laravel. my code is as follows. the first query executes normally but the second seems to be ignored. what is the correct way to do this?</p>
  
  <pre><code>public function scopeUpdateStatus($query,$oldUser, $newUser, $alias, $env) {
  
  $query-&gt;where('db_conn_app_alias_user', $newUser)-&gt;where('db_conn_app_alias', $alias)-&gt;where('app_instance_environment', $env)-&gt;update(array('user_status' =&gt; 'active'));
  $query-&gt;where('db_conn_app_alias_user', $oldUser)-&gt;where('db_conn_app_alias', $alias)-&gt;where('app_instance_environment', $env)-&gt;update(array('user_status' =&gt; 'passive'));
  
  return "success";
  }
  </code></pre>