app/Http/Controllers/ListController.php
private function allFolders(Tree $tree): array
    {
        $folders = DB::table('media_file')
            ->where('m_file', '=', $tree->id())
            ->where('multimedia_file_refn', 'NOT LIKE', 'http:%')
            ->where('multimedia_file_refn', 'NOT LIKE', 'https:%')
            ->where('multimedia_file_refn', 'LIKE', '%/%')
            ->pluck('multimedia_file_refn', 'multimedia_file_refn')
            ->map(static function (string $path): string {
                return dirname($path);
            })
            ->unique()
            ->sort()
            ->all();

        // Ensure we have an empty (top level) folder.
        array_unshift($folders, '');

        return array_combine($folders, $folders);
    }
private function allFolders(Tree $tree): array
    {
        $folders = DB::table('media_file')
            ->where('m_file', '=', $tree->id())
            ->where('multimedia_file_refn', 'NOT LIKE', 'http:%')
            ->where('multimedia_file_refn', 'NOT LIKE', 'https:%')
            ->where('multimedia_file_refn', 'LIKE', '%/%')
            ->pluck('multimedia_file_refn', 'multimedia_file_refn')
            ->map(static function (string $path): string {
                return dirname($path);
            })
            ->unique()
            ->sort()
            ->all();

        // Ensure we have an empty (top level) folder.
        array_unshift($folders, '');

        return array_combine($folders, $folders);
    }
private function allFolders ( Tree $ tree ) : array { $ folders = DB :: table ( 'media_file' ) -> where ( 'm_file' , '=' , $ tree -> id ( ) ) -> where ( 'multimedia_file_refn' , 'NOT LIKE' , 'http:%' ) -> where ( 'multimedia_file_refn' , 'NOT LIKE' , 'https:%' ) -> where ( 'multimedia_file_refn' , 'LIKE' , '%/%' ) -> pluck ( 'multimedia_file_refn' , 'multimedia_file_refn' ) -> map ( static function ( string $ path ) : string { return dirname ( $ path ) ; } ) -> unique ( ) -> sort ( ) -> all ( ) ; // Ensure we have an empty (top level) folder. array_unshift ( $ folders , '' ) ; return array_combine ( $ folders , $ folders ) ; }
Generate a list of all the folders in a current tree.

@param Tree $tree

@return string[]
Generate a list of all the folders in a current tree .