title: Laravel 5.7 Import Excel File: Undefined offset
body: <p>I'm trying to import an excel file and save it into the database but I get the error and I don't know what this means, I'm new to Laravel though.  </p>
  
  <blockquote>
    <p>ErrorException (E_NOTICE)
    Undefined offset: 14</p>
  </blockquote>
  
  <p>Here's my code for the Model:</p>
  
  <pre><code>public function model(array $row)
  {
      return new Resident([
          'resident_fname' =&gt; $row[1],
          'resident_lname' =&gt; $row[2],
          'resident_mi'    =&gt; $row[3],
          'resident_dob'   =&gt; $row[4],
          'role'           =&gt; $row[5],
          'resident_age'   =&gt; $row[6],
          'resident_address'  =&gt; $row[7],
          'resident_contact'  =&gt; $row[8],
          'resident_email'    =&gt; $row[9],
          'resident_purok'    =&gt; $row[10],
          'resident_status'   =&gt; $row[11],
          'resident_gender'   =&gt; $row[12],
          'resident_religion' =&gt; $row[13],
          'ResidentVoter_status'  =&gt; $row[14],
      ]);
  </code></pre>
  
  <p>Here's my code for my controller:</p>
  
  <pre><code>public function import(Request $request)
  {
      $import = Excel::import(new ResidentImport, request()-&gt;file('import_file'));
      dd($import);
      return view('pages.residents')-&gt;with('success', 'Imported Successfully');
  }
  </code></pre>
  
  <p>this is the code for my File button:</p>
  
  <pre><code>&lt;form action="{{ url('/import') }}" method="POST" enctype="multipart/form-data"&gt;&lt;/a&gt;
          {{ csrf_field() }}
              &lt;input type="file" name="import_file" style="direction: rtl;"&gt;&lt;/input&gt;
          &lt;button type="submit" name="upload" class="btn btn-success"&gt;Submit&lt;/button&gt;&lt;/form&gt;
  </code></pre>
  
  <p>while here is my routes:</p>
  
  <pre><code>Route::post('/import', 'ImportController@import');
  </code></pre>
  
  <p>Can anyone help me with this? I really don't have any idea with what to do with this error.</p>