Issue
I am using maatwebsite/excel
to read data and I would like to skip the first two rows.
Reading data:
$data = Excel::load('storage/app/temporary'.'/'.$request->input('file'))->get();
return $data;
The above code returns all the rows
How do I skip the first two rows?
Solution
Or you could use limit()
$data = Excel::load('storage/app/temporary'.'/'.$request->input('file'))-->limit(false, 2)->get();
return $data;
Or try adding this line before read-
config(['excel.import.startRow' = 2]);
this was answered here, you can see this link to have a better understanding.
Answered By - Sohel0415
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.