title: Undefined variable: request
body: <p>When I tried to upload the file it shows error:</p>
  
  <blockquote>
    <p>Undefined variable: request</p>
  </blockquote>
  
  <p>This is where I used it:
  UploadController:</p>
  
  <pre><code>if($request-&gt;hasFile('file')){
          $file = $request -&gt;file('file');
          $fileName = $file-&gt;getClientOriginalName();
          $destinationPath = config('app.fileDesinationPath').'/'.$fileName;
          $uploads = Storage::put($destinationPath,file_get_contents($file-&gt;getRealPath()));
  
      }
      return redirect()-&gt;to('/upload');
  </code></pre>
  
  <p><strong>What's wrong here?</strong></p>