
This my data that I want to store my pdf files in my public folders. Anyone can give me any idea?
I tried to foreach the data to get that file but it seems not working in my end. Anyone can help me?

This my data that I want to store my pdf files in my public folders. Anyone can give me any idea?
I tried to foreach the data to get that file but it seems not working in my end. Anyone can help me?
Copyright © 2021 Jogjafile Inc.
To store files in your public folder you can use the public disk that's included in your application's filesystems configuration file, the default config will store files in
storage/app/public.To make these files accessible from the web though (which I'm assuming is what you want) you need to create a symbolic link from
public/storagetostorage/app/public.To do that just run:
Once you've done this you can use Laravel's
storagefacade to interact with the files in your public folder to save, retrieve and download them.Store
Download
Retrieve
If you need to store user uploaded files to your public storage, you can do it like this:
Laravel's
storemethod will generate a unique ID for the filename and the extension will be determined by the MIME type of the uploaded file. The store method also returns the path, including the generated filename, so you can store it in your DB if needed.If you need to specify the filename then you can do this:
Just a note, I'm assuming you'll be having
publicas your default disk, if not, then you'll need to specify the disk you're using in these method / Storage facade calls.And a further note, when using the public disk, everything - by default - gets stored under
storage/app/publicso anytime you're defining a folder to store your uploaded PDFs under, it'll bestorage/app/public/yourFolder.