Support the ongoing development of Laravel.io →
Requests Input Views

Hi,

How can I list all the files from my Controller and pass it to my View?

Last updated 2 years ago.
0

Controller :

public function getUploadPdf() { return View::make('file.uploadpdf') ->with('files', File::allFiles('uploads')); }

View:

@foreach($files as $file) <table> <td> <tr>{{ $file }}</tr> </td> </table>

    @endforeach
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.