title: Laravel uploading file using vue3
body: <p>i am trying to upload file in Laravel storage folder using vue3 composition API. i have added code but file is not being uploaded.</p>
  <p>routes are correct, only <strong><code>null</code></strong> value is being added in mysql.</p>
  <p>i have 3 columns in mysql database.</p>
  <p><code>id</code> | <code>file_name</code> | <code>file_path</code></p>
  <p><strong>html</strong></p>
  <pre><code> &lt;input    ref=&quot;file&quot; v-on:change=&quot;handleFileUpload()&quot;  type=&quot;file&quot; /&gt;
  
   &lt;button @click=&quot;senddata&quot; class=&quot;&quot;&gt;UPLOAD&lt;/button&gt;
  </code></pre>
  <p><strong>Vue function:</strong></p>
  <pre><code>&lt;script&gt;
  import axios from &quot;axios&quot;;
  import { defineComponent,ref } from 'vue'
  export default defineComponent({
    setup() {
  
        const file = ref(null)
       const handleFileUpload = async() =&gt; {
             // debugger;
              console.log(&quot;selected file&quot;,file.value.files)
              //Upload to server
          }
  
  
  function senddata() {
      
       axios.post('http://127.0.0.1:8000/api/store-files',{
       file:this.file,
       
        }).then(response=&gt;{
        message=response.data.message; 
        alert(message);
  
        });
  }
  
      return {
          senddata,
          handleFileUpload,
          file
      };
  }
  })
  &lt;/script&gt;
  </code></pre>
  <p><strong>Laravel Store Controller:</strong></p>
  <pre><code> public function store(Request $request)
      {
   $file=new Files();
    if($request-&gt;file()) {
              $file=new Files();
               $file_name = time().'_'.$request-&gt;file-&gt;getClientOriginalName();
               $file_path = $request-&gt;file('file_link')-&gt;storeAs('uploads', $file_name, 'public');
   
               $file-&gt;file_name = time().'_'.$request-&gt;file-&gt;getClientOriginalName();
               $file-&gt;file_path = '/storage/' . $file_path;
               $file-&gt;save();
               return response()-&gt;json([
                  'message' =&gt; 'File  added'
              ]);
          }
  }
  </code></pre>