title: Laravel get path of saved file from upload
body: <p>I have a laravel upload for file (along with other data that is passed to the database) Everything works. But I just can't figure out how to save the path of the file that is saved.</p>
  
  <p>Here is my controller function:</p>
  
  <pre><code>public function store(Request $request)
  {
      request()-&gt;validate([
          'name'              =&gt; 'required',
          'logo'              =&gt; 'nullable',
          'original_filename' =&gt; 'nullable',
      ]);
  
      //This is where the file uploads?
      if ($request-&gt;hasFile('logo')) {
          $request-&gt;file('logo')-&gt;store('carrier_logo');
          $request-&gt;merge([
              'logo'              =&gt; '',//TODO: get file location
              'original_filename' =&gt; $request-&gt;file('logo')-&gt;getClientOriginalName(),
          ]);
      }
  
      Carrier::create($request-&gt;all());
      return redirect()-&gt;route('carriers.index')-&gt;with('toast', 'Carrier created successfully.');
  }
  </code></pre>
  
  <p>The thing I want to achieve:
  I want <code>logo</code> to fill with something like <code>carrier_logo/ZbCG0lnDkUiN690KEFpLrNcn2exPTB8mUdFDwAKN.png</code></p>
  
  <p>The thing that happened every time I tried to fix it was that it placed the temp path in the database. Which ended up being something in the PHP install directory.</p>