title: Laravel - Save multiple field values in json/array in a column
body: <p>I have 3 form fields <code>name, address, profile_photo</code>. I want to save there 3 fields in json/array format in a single column so that I can retrieve it later in view blade.</p>
  
  <p><strong>My form looks like this</strong>
  <a href="https://i.stack.imgur.com/uyvj2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uyvj2.png" alt="Dynamic fields"></a></p>
  
  <p><strong>I tried</strong></p>
  
  <pre><code>$customer_details= new Customer;
    {
  
     $profile_photo = $request-&gt;file('profile_photo');
     for ($i=0; $i &lt; count(request('profile_photo')); $i++) {
  
     $pro_fileExt =  $profile_photo[$i]-&gt;getClientOriginalExtension();
     $pro_fileNameToStore = time().'.'.$pro_fileExt;
  
     $pro_pathToStore = public_path('images');
  
     Image::make($profile_photo[$i])-&gt;save($pro_pathToStore . DIRECTORY_SEPARATOR. $pro_fileNameToStore);
     $profile_ph = '/images/'.$pro_fileNameToStore; }
  
     $cust_details=json_encode(request(['name', 'address', $profile_ph]));
     $customer_details-&gt;details = $cust_details;
     $customer_details-&gt;save();
    }
  </code></pre>
  
  <p>With this profile_photo is not saved but other data are saved as:</p>
  
  <pre><code>{"name":["john","Sam"],"address":["CA","FL"]}
  </code></pre>
  
  <p>How can I save all there fields including profile_photo and show each details distinctly later on view blade?</p>