title: How to change the collection on the basis of array in column value
body: <p>I want to change the laravel collection because I want to pass this collection to generate report.
  How to change collection on the basis of the value in the column.</p>
  <p>Previous:</p>
  <pre><code>Illuminate\Support\Collection Object
  (
  [items:protected] =&gt; Array
  (
  [0] =&gt; stdClass Object
  (
  [id] =&gt; 23
  [form_type] =&gt; radio
  [details] =&gt; [{&quot;id&quot;:55 title:&quot;AA&quot; name:&quot;BB&quot;}, {&quot;id&quot;:56 title:&quot;CC&quot; name:&quot;DD&quot;}]
  )
  [1] =&gt; stdClass Object
  (
  [id] =&gt; 24
  [form_type] =&gt; checkbox
  [details] =&gt; [{&quot;id&quot;:57 title:&quot;PP&quot; name:&quot;QQ&quot;}, {&quot;id&quot;:58 title:&quot;RR&quot; name:&quot;SS&quot;}]
  )
  )
  )
  </code></pre>
  <p>--details column has array of objects, I want it as below format:</p>
  <pre><code>Illuminate\Support\Collection Object
  (
  [items:protected] =&gt; Array
  (
  [0] =&gt; stdClass Object
  (
  [id] =&gt; 23
  [form_type] =&gt; radio
  [title] =&gt; &quot;AA&quot;
  [name] =&gt;  &quot;BB&quot;     
  )
  [1] =&gt; stdClass Object
  (
  [id] =&gt; 23
  [form_type] =&gt; radio
  [title] =&gt; &quot;CC&quot;
  [name] =&gt;  &quot;DD&quot;     
  )        
  [2] =&gt; stdClass Object
  (
  [id] =&gt; 24
  [form_type] =&gt; checkbox
  [title] =&gt; &quot;PP&quot;
  [name] =&gt;  &quot;QQ&quot;
  )
  [4] =&gt; stdClass Object
  (
  [id] =&gt; 24
  [form_type] =&gt; checkbox
  [title] =&gt; &quot;RR&quot;
  [name] =&gt;  &quot;SS&quot;
  )
  )
  )
  </code></pre>