title: How to format date in Laravel 5.8 From "Thu Apr 11 2019 00:00:00 GMT+0200" to MySQL format?
body: <p>I'm  working on the backend for an App for school and I got a problem converting a date that I get from a request like "Thu Apr 11 2019 00:00:00 GMT+0200" to MySQL format (timestamp).</p>
  
  <pre><code>
  public function getAll(Request $request){
          $start = $request-&gt;input('start');
          $end = $request-&gt;input('end');
  
          // we receive some thing like:
          // Thu Apr 11 2019 00:00:00 GMT+0200 (Central European Summer Time)
          $sales = Sale::with('SaleLine.lens','SaleLine.cadre','cli_sale')
                      -&gt;whereBetween('created_a', [$start, $end])
                      -&gt;orderBy('id', 'desc')-&gt;get();
  
          for ($i=0; $i &lt; count($sales); $i++) {
              $sales[$i]['client_name'] = $sales[$i]['cli_sale']['first_name'] . " " . $sales[$i]['cli_sale']['last_name'];
          }
          return response()-&gt;success(['sales'=&gt;$sales]);
      }
  </code></pre>