title: Unable to get value of variable in laravel controller
body: <p>Laravel 6. PHP 7.4</p>
  <p>I've a form where I can upload multiple images. My images are uploading into storage folder and now I'm interested to find a way to get the path of all uploaded images so that I can save into databases.</p>
  <p>I just started with a simple method of getting path and good news is I got the path but the variable containing the path is not accessible outside If clause on hitting code:</p>
  <pre><code>  $store_seller-&gt;save();
  </code></pre>
  <p>I am trying to figure out how I can upload the multiple strings as paths of images.</p>
  <p>Blade</p>
  <pre><code> &lt;form method=&quot;POST&quot;  enctype=&quot;multipart/form-data&quot; id=&quot;msform&quot; 
       action=&quot;{{route('niceActionController.multiStepStore')}}&quot;&gt;
  
        &lt;div id=&quot;dropzoneForm&quot; required class=&quot;dropzone&quot;&gt;&lt;/div&gt;
  
  &lt;/form&gt;
  </code></pre>
  <p>Controller</p>
  <pre><code>public function multiStepStore(Request $request)
  {
  $store_seller = new Sellers();
      
      $store_seller-&gt;generation = $request['generation'];
      $store_seller-&gt;trim = $request['trim'];
      $store_seller-&gt;regist_year = $request['regist_year'];
      $store_seller-&gt;emission_class = $request['emission_class'];
      $store_seller-&gt;engine_type = $request['engine_type'];
      $store_seller-&gt;gearbox = $request['gearbox'];
      $store_seller-&gt;engine_volume = $request['engine_volume'];
      $store_seller-&gt;engine_power = $request['engine_power'];
  
      $now = date('Y-m-d');
      $request['maintenance'] = $now;
      $store_seller-&gt;maintenance =$request['maintenance'];
      $store_seller-&gt;maintenance = $now;
  
  
        if ($request-&gt;file('file')!=null)
        {
  
          $filename = $request-&gt;file('file')-&gt;getClientOriginalName();
          $image = $request-&gt;file('file')-&gt;storeAs('public/images',$filename);
          $store_seller-&gt;img_path = $image;
  
        }
  
        $store_seller-&gt;save();
  
  }
  </code></pre>
  <p><code>dd($store_seller);</code> returns all the values into database except the <strong>img_path</strong>.</p>