Support the ongoing development of Laravel.io →
Database Eloquent Views

here is the scenario, I need a table called product and another table called product_image and they are related from model. now what i need to do is i need to store multiple images for single product. and those images should be stored in database anyway. I have done up to storing the image doing this in controller: public function uploadSubmit(UploadRequest $request) { // Coming soon... $product = Product::create($request->all()); foreach ($request->photos as $photo) { $filename = $photo->store('photos'); ProductsPhoto::create([ 'product_id' => $product->id, 'filename' => $filename ]); } return redirect('/upload/{id}');; } But i actually it would be okay if the images were saved to public folder in place of storage. Because i dont know to access images form storage folder. So i want to store the image in public folder. Can anyone help on this? Or you could provide the full tutorial for the provided scenario in your own way. I would be happy to use them all.

Last updated 2 years ago.

jessicaervin liked this thread

1

Try this command if you didn't have already: php artisan storage:link

Reference: Laravel Filesystem

Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Tekrajs tekrajs Joined 21 Feb 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.