When i have a variable like:
$storagePath = ('/xampp/htdocs/systeembeheer/public/download');
$files = File::allFiles($storagePath);
return View::make('documentatie.overzicht') ->with('files', $files);
In my view, the files displayed as:
/xampp/htdocs/systeembeheer/public/download/test.txt
, but I want to see only test.txt
.
You have to use basename which returns trailing name component of path.
So in your view use something like
//$file is full path
echo basename($file);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With