title: Laravel 5.2 - convert json key values to array
body: <p>I have the following json object:</p>
  
  <pre><code>{"keywords": "foo", "industries":"1,37","contractTypes":"1"}
  </code></pre>
  
  <p>How can i convert the following key values in to an array as follows:</p>
  
  <pre><code>{"keywords": "foo", "industries": ["1", "37"], "contractTypes": ["1"]}
  </code></pre>
  
  <p>So basically I want to loop through the object and if property <code>industries</code> and <code>contractTypes</code> exist and not empty then convert the values into array.</p>