Answer the question
In order to leave comments, you need to log in
How to display all the images that are in the public / img folder?
For example, this is how we display some kind of data array:
foreach( $posts as $post )
{
echo $post->body;
}
public/img
in the same way? There are svg and png images. Or is there something in Laravel for that? I did not find...(
Answer the question
In order to leave comments, you need to log in
Found the answer:
use Illuminate\Support\Facades\Storage;
$files = Storage::files($directory);
$files = Storage::allFiles($directory);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question