I’m tryng to upload image from a form in laravel but i get this in postman on dd($request->image)
Laravel version is 8.12
i have problem to get images on request , i’ve used/imported Request $request in my function and globally in my controller
IlluminateHttpUploadedFile {#1900
-test: false
-originalName: "IMG_20211015_104550_306.jpg"
-mimeType: "image/jpeg"
-error: 0
#hashName: null
path: "C:xampptmp"
filename: "php9F5A.tmp"
basename: "php9F5A.tmp"
pathname: "C:xampptmpphp9F5A.tmp"
extension: "tmp"
realPath: "C:xampptmpphp9F5A.tmp"
aTime: 2022-03-11 09:47:40
mTime: 2022-03-11 09:47:40
cTime: 2022-03-11 09:47:40
inode: 6192449487666182
size: 153950
perms: 0100666
owner: 0
group: 0
type: "file"
writable: true
readable: true
executable: false
file: true
dir: false
link: false
linkTarget: "C:xampptmpphp9F5A.tmp"
}
in my controller:
if (isset($request->immagini)) {
$realPath=[];
foreach ($request->file('immagini') as $key => $value) {
dd($value);
// $realPath = $value->store('images/mail', 'public');
$realPath =Storage::disk('public')->put('images/mail', $value);
}
}
else {
$realPath=null;
}
$data = [
$request->type,
$realPath,
$nome,
$mailMittente,
$telefono,
$anno,
$info,
$km,
$cilindrata,
$alimentazione,
$targa,
$marca,
$cognome,
$modello
];
dd($request->immagini);
i can’t access to dd($value) and i get realPath=[].