In Laravel I want to get all images from a dir, I just have a problem getting the path to the public folder.
$images = [];
foreach(File::glob('/public/img/uploads/*.*') as $filename) {
$images[] = $filename;
}
If I use this function it returns nothing, I also tried using public_path()
but that returns the full path including my F:// dir.
It does it as manual reads:
I doubt your public directory is in your root folder and this is what your absolute path you used points to, so use what
public_path()
returns - it rather is nothing to bother it is full qualified path.