You need to change the way you are getting the files from the public folder.
Below is the working solution for your problem.
foreach (File::glob(public_path() . '/images/nodes/*.jpg*') as $filename) {
echo "$filename size " . filesize($filename) . "\n";
}
The above code snippet will get all the files from the nodes folder with .jpg
extensions.
g10rg liked this reply
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community