title: how to import excel file in mysql using laravel 5.7 with vue JS
body: <p>i was creating vue file for inpute Excel or csv file laravel 5.7
  i was using Maatwebsite/Laravel-Excel
  dont know how to route there things it if my first time to make app like laravel with vue JS
  Don't know what to doo
  there is Vue file</p>
  
  <pre><code>    &lt;template&gt;
      &lt;div class="container"&gt;
          &lt;div class="row mt-5"&gt;
            &lt;div class="col-md-12"&gt;
              &lt;div class="card"&gt;
                &lt;div class="card-header"&gt;
                  &lt;h3 class="card-title"&gt;Students&lt;/h3&gt;
  
                  &lt;div class="card-tools"&gt;
                      &lt;button class="btn btn-success" data-toggle="modal" data-target="#exampleModal"&gt;Add New &lt;i class="fas fa-user-plus"&gt;&lt;/i&gt;&lt;/button&gt;
                      &lt;button class="btn btn-primary" data-toggle="modal" data-target="#importModel"&gt;Import &lt;i class="fas fa-file-excel"&gt;&lt;/i&gt;&lt;/button&gt;
                      &lt;button class="btn btn-warning" data-toggle="modal" data-target="#export"&gt;Export &lt;i class="fas fa-file-excel"&gt;&lt;/i&gt;&lt;/button&gt;
  
                  &lt;/div&gt;
                &lt;/div&gt;
  
              &lt;/div&gt;
              &lt;!-- /.card --&gt;
            &lt;/div&gt;
          &lt;/div&gt;&lt;!-- /.row --&gt;
          &lt;!-- Modal --&gt;
          &lt;div class="modal fade" id="importModel" tabindex="-1" role="dialog" aria-labelledby="importModelLabel" aria-hidden="true"&gt;
          &lt;div class="modal-dialog" role="document"&gt;
              &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;h5 class="modal-title" id="importModelLabel"&gt;Import Excel&lt;/h5&gt;
                  &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;
                  &lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;
                  &lt;/button&gt;
              &lt;/div&gt;
              &lt;form method="POST"   enctype="multipart/form-data"&gt;
                  &lt;div class="modal-body"&gt;
                          &lt;div class="form-group"&gt;
                              &lt;label&gt;Import&lt;/label&gt;
                              &lt;input type="file" name="excel_file"
                                  class="form-control" :class="{ 'is-invalid': form.errors.has('excel_file') }"&gt;
                          &lt;/div&gt;
  
  
                  &lt;/div&gt;
                  &lt;div class="modal-footer"&gt;
                      &lt;button type="button" class="btn btn-danger" data-dismiss="modal"&gt;Close&lt;/button&gt;
                      &lt;button type="button" class="btn btn-primary"&gt;Save Student&lt;/button&gt;
                  &lt;/div&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;!--Exit Modal--&gt;
      &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
      export default {
          data(){
              return{
                  form: new Form({
                      first_name:'',
                      last_name:'',
                      email:'',
                      password:'',
                      designation:''
                  })
              }
          },
          mounted() {
              console.log('Component mounted.')
          }
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>set a post route to import data in web.php file
  that will route the things as pr laravelExcel</p>
  
  <pre><code>Route::post('importExcel', 'API/StudentMasterController@import');
  </code></pre>
  
  <p>in a controller file</p>
  
  <pre><code>public function import()
  {
      Excel::import(new StudentImport, request()-&gt;file('excel_file'));
        //return redirect('/')-&gt;with('success', 'All good!');
  }
  </code></pre>
  
  <p>and in a APP/import/studentmaster.php file</p>
  
  <pre><code>public function model(array $row)
  {
      return new Student_master([
          'EnrollmentNo'     =&gt; $row[22],
      ]);
  }
  </code></pre>