I have checked several others codes online but they seem to be working fine but mine keeps saying that move cannot be used on an array
$files = $request->file('file');
foreach ($files as $file){
$filename = time().'.'.$file->getClientOriginalExtension();
$location = public_path(‘uploads/’.$filename);
$request->file->move(public_path(‘/uploads’), end($filename));
$filename_arr = [];
array_push($filename_arr, $filename);
$filename = json_encode($filename_arr);
$upload->filename = $filename;
}