title: How to import specific cell value to model in Laravel excel
body: <p>I want to import spreadsheet data to sql database,
   this is my speadsheet,
  <a href="https://i.stack.imgur.com/BayKm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BayKm.jpg" alt="Speadsheet to import"></a></p>
  
  <p>And this is my view and controller,</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use App\DailyAttendance;
  use Illuminate\Http\Request;
  use App\Exports\DailyAttendanceExport;
  use App\Imports\DailyAttendanceImport;
  use Maatwebsite\Excel\Facades\Excel;
  
  
  class DailyAttendanceController extends Controller
  {
      /**
       * Display a listing of the resource.
       *
       * @return \Illuminate\Http\Response
       */
      public function index()
      {
          $dailyAttendance = DailyAttendance::all();
  
          return view('daily_attendance.index')-&gt;with('dailyAttendance', $dailyAttendance);
      }
  
  
       /**
       * Import function
       */
      public function import(Request $request)
      {
          if ($request-&gt;file('imported_file')) {
  
              $import = new DailyAttendanceImport();
              $import-&gt;onlySheets('Logs');
              Excel::import($import, request()-&gt;file('imported_file'));
              return back();
          }
      }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form id="upload_excel" method="post" enctype="multipart/form-data" action="{{ route('dailyAttendance.import') }}" autocomplete="off"&gt;
                                      @csrf                                                       
                                      @method('post')                                                               
                                      &lt;input type="file" name="imported_file" required&gt;         
                              &lt;button style="margin-left: 10px;" class="btn btn-info" type="submit"&gt;Upload attendance&lt;/button&gt;                        
                              &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Also this is my model class ,</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class DailyAttendance extends Model
  {
     /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'emp_id', 'date','start','end',
      ];
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>and I also created import class ,</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  
  namespace App\Imports;
  
  use App\DailyAttendance;
  use Maatwebsite\Excel\Concerns\ToModel;
  use Maatwebsite\Excel\Concerns\WithHeadingRow;
  
  class DailyAttendanceImport implements ToModel, WithHeadingRow
  {
      /**
      * @param array $row
      *
      * @return \Illuminate\Database\Eloquent\Model|null
      */
      public function model(array $row)
      {
          //
      }
  }
  
  
  // change this to import data to an array instead of db...........</code></pre>
  </div>
  </div>
  </p>
  
  <p>but according to documentation,<a href="https://docs.laravel-excel.com/3.1/imports/basics.html" rel="nofollow noreferrer">laravel excel documentation</a> sheet values can only import as rows, for example</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>return new DailyAttendance([
              'emp_id' =&gt; $row['emp_id'],
              'date' =&gt; $row['date'],
              'start' =&gt; $row['start'],
              'end' =&gt; $row['end'],
          ]);</code></pre>
  </div>
  </div>
  </p>
  
  <p>and because of my excel sheet format I want to capture values by their cell addresses,Can anyone show me how to import cell values to the model , thanks!</p>