title: Convert requests to Json in laravel
body: <p>I want to store several requests that comes from a form to single column as json. I know i can use <a href="https://laravel.com/docs/5.0/eloquent#converting-to-arrays-or-json" rel="nofollow noreferrer">toJson</a> but that's in case you returning data from database. In my case my data comes from a form like <code>$request-&gt;input('address_id');</code> and more.</p>
  
  <pre><code>//incoming data
  array:8 [▼
    "address_id" =&gt; "3"
    "weight" =&gt; "3"
    "shipping_cost" =&gt; "9000"
  ]
  </code></pre>
  
  <blockquote>
    <p>This data above is just sample (i have more inputs but let say i only need
    to make JSON of this 3 inputs)</p>
  </blockquote>
  
  <p>How can I do that?</p>