title: Laravel: Uploading of file to storage not working
body: <p>I'm trying to upload image to storage. I'm currently got this object but seems unfortunate to save on app/storage</p>
  
  <pre><code>Illuminate\Http\UploadedFile Object
  (
      [test:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; 
      [originalName:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; lamborghini_veneno_art_minimalism_99945_1366x768.jpg
      [mimeType:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; image/jpeg
      [size:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; 117303
      [error:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; 0
      [hashName:protected] =&gt; 
      [pathName:SplFileInfo:private] =&gt; C:\xampp\tmp\php82F7.tmp
      [fileName:SplFileInfo:private] =&gt; php82F7.tmp
  )
  </code></pre>
  
  <p>Here is my code.</p>
  
  <p>In profile.vue I have click event from input file.</p>
  
  <pre><code>onFilePicked(event){
      const files = event.target.files
      const data = new FormData();
      data.append('avatar', files[0]);
      this.$store.dispatch('uploadImage_profile',data)
          .then(response=&gt;{
  
          })
          .catch(error=&gt;{
  
          })
  }
  </code></pre>
  
  <p>Then send using axios</p>
  
  <pre><code>    axios({
          url: '/prod/api/uploadImage_profile',
          method: 'post',
          data: obj
      })
      .then(response=&gt;{
          if(response.status == 200){
              resolve(response.data)
          }
      })
      .catch(error=&gt;{
          if(error.response){
              reject(error.response.data);
          }
      })
  </code></pre>
  
  <p>And my Controller.php</p>
  
  <pre><code>public function uploadImage_profile(Request $request){
      $response = [];
      //var_dump($request-&gt;file('avatar'));
      //$path = $request-&gt;file('avatar')-&gt;store('avatars');
    if($request-&gt;hasFile('avatar')){
      $file = $request-&gt;file('avatar');
      Storage::put('file.jpg', $file);
    }
  
    return response()-&gt;json($response);
  }
  </code></pre>