Laravel v10.47.0
PHP v8.2.13
currently using maatwebsite/excel
A user will upload an excel file via webform that will contain information to be inserted in a table in a database. Contains 5 columns: code, concept, price, quantity, photo (optional). Each row is a record (including the photo)
I have no problems to get the first 4 columns, but the photo part I need to extract the image and save in disc to be used later.
Currently I have this code:
$sheets = Excel::toArray(new RecordImport, $tempPathOfExcelFile);
foreach ($sheets as $sheet) {
foreach ($sheet as $idx => $row) {
// validation and insert record
}
}
How I can “read” the image on each row (if it have one) and save it in disk?