title: Laravel update multiple records at once
body: <p>I have a mysql database table with 1000000 records. I wanted to update one column in each row. </p>
  
  <p><strong>I tried</strong>: </p>
  
  <pre><code>public function methodWorking()
  {
      $properties = Property::with('requests')-&gt;get();
      foreach ($properties as $property) {
          $property-&gt;number_of_request = count($property-&gt;requests);
          $property-&gt;save();
      }
  }
  </code></pre>
  
  <p>This one is working but, it's very bad in performance wise.</p>
  
  <p><strong>I wanted to write a code like this:</strong></p>
  
  <pre><code>public function methodExpect()
  {
      $properties = Property::with('requests')-&gt;get();
      $property_array = [];
      foreach ($properties as $property) {
          $property-&gt;number_of_request = count($property-&gt;requests);
          $property_array[] = $property;
      }
  
      Property::save($property_array);
  }
  </code></pre>
  
  <p>Is it possible with laravel ?</p>
  
  <p>Thanks.</p>