Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

gobs's avatar
Level 1

I'm trying to register products with more than one image using the dropbox api in laravel

I'm trying to register products with more than one image using the dropbox api in laravel. I registered the product in the database, where it registers the name and just the description of the product (I'm just doing a test). I was also able to upload the images in the dropbox. The images are separated by folders and the folders are named after the product. I was also able to show all the images on the screen. My problem is to get the image that belongs to the product. Can someone who has already used and has knowledge help me?

0 likes
6 replies
gitwithravish's avatar
Level 16

@gobs Product table should have a column that stores path or url of the image. Using that data you will get to the image of the particular product.

Usually when you upload the file on dropbox, there must be a way to get the url of the image. You should first upload the image on dropbox and then save the returned url in your product record along with the product name and description.

[EDIT]

Upload


$path = Storage::disk('dropbox')->putFile('/images', $uploadedFile);
Product::create([
	'name' => request('name'),
	'description' => request('description'),
	'img_path' => $path,
]);

Retrieve

<img src="{{ \Storage::disk('dropbox')->url($product->img_path) }}">

``

1 like
gobs's avatar
Level 1

Cool, thanks. I will try to apply this logic

1 like
gobs's avatar
Level 1

You're amazing kkkkk. Thanks guys

2 likes

Please or to participate in this conversation.