title: Laravel Update Record using Query Builder
body: <p>I working on laravel project and trying to update record using query builder but it not working , 
  this is the function where I trying to edit the record in it</p>
  
  <pre><code>public function editchecksave(Request $request)
  {
      $id = $request-&gt;id;
      $username = $request-&gt;username;
      $attribute = $request-&gt;attribute;
      $value = $request-&gt;value;
      $op = $request-&gt;op;
  
      $result = DB::update('update radcheck set username = "?" , 
          attribute="?",value="?" ,op="?" where id = ?', 
          [$username,$attribute,$value,$op,$id]
      );
  
      if ($result)
      {
          return response()-&gt;json([ 'msg' =&gt; 'Updated Successfully' . $username]);
      }
  
      return response()-&gt;json([ 'msg' =&gt; 'Not Updated Successfully'. $value]);
  }
  </code></pre>
  
  <p>this is the route </p>
  
  <pre><code> Route::get( 'radcheckedit', 'radcheckController@editchecksave' );
  </code></pre>
  
  <p>when I do not change the first element in the update query it not updated but when I change the first element it updated successfully .in other words (when I change the value of username it updated successfully and when I do not change the username not updated , when I put the attribute first element in the query it must change the value of it to make update so user must change the first value of query and it not good because user may be doesn't want to edit this element)</p>
  
  <p>it give me the Message Not updated successfully</p>