title: update table with csv using laravel
body: <p>I'm trying to update a table using Maatwebsite/Laravel-Excel.</p>
  
  <pre><code>public function import(Request $request)
  {
    if($request-&gt;file('imported-file'))
    {
              $path = $request-&gt;file('imported-file')-&gt;getRealPath();
              $data = Excel::load($path, function($reader)
        {
              })-&gt;get();
  
        if(!empty($data) &amp;&amp; $data-&gt;count())
        {
          foreach ($data-&gt;toArray() as $row)
          {
            if(!empty($row))
            {
              $dataArray[] =
              [
                //'name' =&gt; $row['name'],
                'age' =&gt; $row['age'],
                'phone' =&gt; $row['phone'],
                //'created_at' =&gt; $row['created_at']
              ];
            }
            if(!empty($dataArray))
              {
                  //Item::insert($dataArray);
                  DB::table('items')
                  -&gt;where('name', $row['name'])-&gt;update($dataArray);
  
                  return view('imported')-&gt;with('success', 'Course updated');
              }
        }
  
       }
     }
  }
  </code></pre>
  
  <p>But its giving error:</p>
  
  <blockquote>
    <p>SQLSTATE[42S22]: Column not found: 1054 Unknown column '0' in 'field list' (SQL: update items set 0 = 20 where name = james </p>
  </blockquote>
  
  <p>Here's my csv</p>
  
  <pre><code>name,age,phone
  James,20,888839939
  Joseph,54,3444444
  Hanson,30,99999999
  </code></pre>
  
  <p>The above is the csv file i'm trying to update.</p>