Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To get a record of all the files in a public folder in Laravel, you can use the following code:

$files = Storage::disk('public')->files();

This will give you an array of file names in the public disk. If you want to get detailed information about each file, you can use the allFiles() method instead:

$files = Storage::disk('public')->allFiles();

This will give you an array of file paths, where each path includes the storage path and the file name. You can then parse the paths to get the file names or other details you need.