Echo's avatar
Level 1

Response::make method doesn't exist.

I was hoping someone here could help me out. I've just started learning Laravel (and I'm fairly new to webdevelopment in general). I was working through a fairly old cast which used a Response::make(params) call to return an image. Unfortunately when I tried to use Response::make, it says that no method is designed. I've looked in both the definition of the illuminate responses as well as the documentation but I can't figure it out.

It would be fantastic if someone had some advice. I'm trying to make a preview page using an uploaded image, but I don't know another way of turning the var $img = Input::file('image') into an actual image in HTML.

Thank you very much for any help you can give!

0 likes
1 reply
bashy's avatar

Yeah it's a hard one but there's two ways I can think of.

Not sure if this works

$response = Response::make(Input::file('image'), 200);
$response->header('Content-Type', 'image/jpeg');

return $response;

Or use this package for generating images and manipulating them http://image.intervention.io

Please or to participate in this conversation.