title: How to use update() functionality in Laravel?
body: <p>Inside my store function i have to search a name of a particular person, thus:</p>
  
  <pre class="lang-php prettyprint-override"><code>$person = DB::select("select p.* from persons p where concat_ws(', ' ,p.family_name,concat_ws(' ',concat_ws(' ',p.first_name,p.middle_name),p.third_name)) like ?", [$request['person_name']]);
  </code></pre>
  
  <p>If this person exist i have to update the person and this one works:</p>
  
  <pre><code>Person::where('id', $person[0]-&gt;id)-&gt;update(['status' =&gt; 'Active']);
  </code></pre>
  
  <p>but not this one:</p>
  
  <pre class="lang-php prettyprint-override"><code>$person[0]-&gt;status = 'Active';
  $pArray = json_decode(json_encode($person[0]), true);
  $per = new Person($pArray);
  $per-&gt;update();
  </code></pre>