patipat chewprecha
patipat chewprecha

Reputation: 285

How to get value from A3 in Laravel Excel maatwebsite

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');

Upvotes: 0

Views: 1150

Answers (1)

tokkerbaz
tokkerbaz

Reputation: 397

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'];
    }

Upvotes: 1

Related Questions