i'm using this library to upload excel files and store the data from excel to database .. and i want to store images from excel to storage but not succeed .. this is my code
public function addExcel(Request $request)
{
$request->validate([
'file' => 'required'
]);
Excel::load($request->file('file')->getRealPath(), function ($reader) {
foreach ($reader->toArray() as $key => $row) {
$data['model_name'] = $row['model_name'];
$data['part_number'] = $row['part_number'];
if(!empty($data)) {
DB::table('products')->insert($data);
}
}
});
return 'done';
}