jbowman99's avatar

Image handling and Display

I watched the lessons on saving an image, is there more lessons on image handling and display.

If not how would one go about uploading an image and attaching it to the associated article created. then displaying it on the form page during creation of the article after it has been uploaded.

I would need this image saved to the DB also, so it can be viewed when all articles are displayed or displayed individually.

any direction is helpful!!

0 likes
5 replies
jbowman99's avatar

my store function has become this

public function store(Request $request) { $obit = new Obit($request->all()); Auth::user()->obits()->save($obit); if (Input::hasFile('photo')) { $file = Input::file('photo'); $name = time() . '-' . $obit->id . '.' . $file->guessClientExtension(); $file->move(public_path().'/images/', $name); $obit->photo = $name; $obit->save(); } return redirect('submitted-entries'); }

when i try to display the image in the view all i get is a broken link icon, when i view the source the path is correct?

any thoughts?

frezno's avatar

the image exists at the desired location? i know, stupid question, but one never knows...

how does the relevant part of your view looks like and how do you call it from your method?

jbowman99's avatar

ended up using this did the trick.

Thanks for the suggestions

Please or to participate in this conversation.