A file must be get with Input::file(...)
Jan 22, 2015
5
Level 4
Upload images over laravel API
I just finished Jeff's tutorial on "Image manipulation" and it all worked fine.
But now I tried to implement the same code into a restful controller and it wont work. My path gets created but no images gets uploaded, and I dont get any errors.
code:
$input = Input::all();
$path = public_path() .'/images/123/';
$x = 1;
File::exists($path) or File::makeDirectory($path);
foreach($input['images'] as $file) {
$thumb = Image::make($file->getRealPath());
$thumb->fit(130, 107)->save($path . 'thumb_' . $thumbImageName, 100);
$thumb->destroy(); // destroy thumbnail instance
$x++; //increment value to only allow one thumbnail
}
So this wont fire "$thumb = Image::make($file->getRealPath());"
I am using postman in chrome to try this if that matters.
Thanks in advance!
Please or to participate in this conversation.