Hi all i am on laravel 7. I want to navigate through the folders and see their contents (subfolders and documents). To do this I used the following
$directories = Storage::directories($path); $directories = Storage::files($path);
Here I will have two loops: one which will browse the documents and the other which will browse the folders.
I would like to have a way to travel the path in question and determine if I have a document or a folder.
thank you in advance
Advertisement
Answer
For Laravel 5.0 +, can use
$storage_path = storage_path().
storage_path Get the fully qualified path to the storage directory.
You may also use the storage_path function to generate a fully qualified path to a given file relative to the storage directory:
$path = storage_path('app/file.txt')
;