title: Laravel : Cannot access protected property Maatwebsite\Excel\Collections\RowCollection
body: <p>I'm importing xlsx into sql, But while importing I'm getting the following Error:</p>
  
  <blockquote>
  <pre><code>FatalThrowableError in ItemController.php line 41:
  Cannot access protected property Maatwebsite\Excel\Collections\RowCollection::$title
  </code></pre>
  </blockquote>
  
  <p>If anyone face the same problem or know what will be the suggestion,hope you'll help me to find it.</p>
  
  <p>Here is my controller part:</p>
  
  <pre><code>    public function importExcel()
          {
  
              if(Input::hasFile('import_file')){
                  $path = Input::file('import_file')-&gt;getRealPath();
                  $data = Excel::load($path, function($reader) {
                  })-&gt;get();
  
                  if(!empty($data) &amp;&amp; $data-&gt;count()){
                      foreach ($data as $key =&gt; $value) {
                       $insert[] = ['title' =&gt; $value-&gt;title, 'description' =&gt; $value-&gt;description];
    //Line : 41                    
                      }
                      if(!empty($insert)){
                          DB::table('items')-&gt;insert($insert);
                        //  dd('Insert Record successfully.');
                      }
                  }
              }
              return back();
          }
  </code></pre>
  
  <p>Route Part:</p>
  
  <pre><code>Route::post('/importExcel',[
          'uses'=&gt;'ItemController@importExcel',
          'as'=&gt;'importExcel'
      ]);
  </code></pre>
  
  <p>Here is the importing xlsx file:</p>
  
  <p><a href="https://i.stack.imgur.com/LsbPw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LsbPw.png" alt="enter image description here"></a></p>
  
  <p>When I dd($data) I saw the following Array:</p>
  
  <pre><code>RowCollection {#464 ▼
    #title: "Sheet1"
    #items: array:2 [▼
      0 =&gt; CellCollection {#390 ▼
        #title: null
        #items: array:3 [▼
          "title" =&gt; "Abdul"
          "description" =&gt; "This is Zaman"
          0 =&gt; null
        ]
      }
      1 =&gt; CellCollection {#410 ▼
        #title: null
        #items: array:3 [▼
          "title" =&gt; "Zaman"
          "description" =&gt; "This is Abdul"
          0 =&gt; null
        ]
      }
    ]
  }
  </code></pre>