Wednesday, March 1, 2017

UploadedFile in $request

I want to access pic in $request which is instance of UploadedFile class but when I use

$request->pic;

it returns nothing...

this is my dd($request->all()) result

array:4 [
"title" => "blah blah
"desc" => "some text"
"respawn" => "mail"
"pic" => UploadedFile {#27
-test: false
-originalName: "hamayesh-hesabdari2.jpg"
-mimeType: "image/jpeg"
-size: 160295
-error: 0
}
]

how can I access it?




via Linton Samuel Dawson

Advertisement