Laravel Filesystem get all directories and exclude some #34619
Unanswered
leo95batista
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
as the title of these questions indicates. I want to get all the directories from a specific path and exclude some.
Example:
I have the following structure in my
resources
directory:And I want to get all the directories in the
js
folder, but exclude theC
folder. So I do the following:I wonder how I can exclude a certain directory (in this case
C
directory) when I make the call to:Doing some research, I have found the following:
This is the
directories
method insidesrc/Illuminate/Filesystem/Filesystem.php
As you can see, it uses the class:
symfony\finder\Finder.php
to iterate over a certain directory. This class(Finder)
contains a method calledexclude
, I was wondering how I could call this method on thedirectories
method provided by theFilesystem
class?Beta Was this translation helpful? Give feedback.
All reactions