0

I use Laravel Excel and I have data at ''A3'' cell. How to get it? I take this code is not working. It's show all data in that sheet. Reference

 $sheet = $doc->getSheetByName('data'); 
 $sheet->getCell('A3');
patipat chewprecha
  • 255
  • 2
  • 6
  • 19

1 Answers1

1

I'm using it too.You can check the array by dd, and get needed cell.

        public function loadExcel(Request $request)
        {
            $path = $request->file('file')->getRealPath();

            $records = \Excel::load($path, function ($reader) {
                  $reader->noHeading();
            })->get()[0]->toArray();

            dd($records);

          //When you find the index of needed cell just $needed_cell = $records['index'];
    }
tokkerbaz
  • 377
  • 1
  • 6