Laravel - File Storage - Get All Directories Within A Directory

The directories method returns an array of all the directories within a given directory. Additionally, you may use the allDirectories method to get a list of all directories within a given directory and all of its subdirectories:

    
    $directories = Storage::directories($directory);
    
    $directories = Storage::allDirectories($directory);