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.
Try this command if you didn't have already: php artisan storage:link
Reference: Laravel Filesystem
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community