title: Laravel 5.4- How to receive JSON data from server and save in Database
body: <p>I am using webservices. My requirement is to receive JSON data from server and store in DB[order table].Customers use to place mutliple Order in mobile.The same has to be received in laravel controller and stored in the order table.I should not use form only via controller I should receive data.
  I am new to this concept of webservices and JSON. </p>
  
  <pre><code>public function receive(Request $request)
  {       
      $data = $request-&gt;json()-&gt;all();
      $order = new order();
      $order-&gt;product_int = $request-&gt;input('products');
      $order-&gt;quantity_float = $request-&gt;input('quantity');
      $order-&gt;amount_float = $request-&gt;input('amount');       
      $order-&gt;save();        
  }
  </code></pre>
  
  <p>In api.php , I am calling <code>Route::get('/receive', 'OrderController@receive');</code>
  The above piece of code does not work.suggestions on how to receive JSON data as function parameter and how to save to DB.</p>