title: Get average delivery time laravel from orders laravel
body: <p>I have a e-commerce application. All delivered orders have a column "updated_at". I can with this column calculate average delivery time total delivered orders?</p>
  
  <p>I have count all orders and column updated_at. What I need do, that calculate average time?</p>
  
  <p>My code:</p>
  
  <pre><code>        $avgDelivery = Order::where('status', '=', '8')-&gt;avg('updated_at');
          $allDelivery = Carbon::parse($avgDelivery)-&gt;formatLocalized('%d'); //get avg days
  </code></pre>
  
  <p>But this return me <code>20180317368025.6000</code> and error: <br>
  <code>DateTime::__counstruct(): Failed to parse time string... Unexpected character</code></p>
  
  <p>How I can get average time delivery with days correctly?</p>