jeudi 1 octobre 2015

Laravel - Using allfiles gives back empty array

I've been using laravel for nearly all my projects and I've came across a problem when trying to list all files in a directory.

Here is my code below:

            $directory = ("upload/"."$username->username");

        $scanned_directory = storage::allfiles($directory);

So as you can see First line is the directory which is in Upload followed by the username of the account.

The second line is meant to scan this directory and list only files. Sadly it always gives me back an empty array. Using Scandir() here works... But it gives me folders which I'm not wanting.

So... Any tips? I checked the API and I really can't see what is wrong here :(



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire