Answer the question
In order to leave comments, you need to log in
How to upload and return images using laravel?
So it goes.
I send images to the server via ajax, but I can’t figure out something, how can I get them back in the server response in order to display them to the user?
Answer the question
In order to leave comments, you need to log in
In the controller that handles saving the image, return a variable containing the path to the file.
public function upload(Request $request) {
$path = $request->file('image')->store('images');
return $path;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question