app/Http/Controllers/Admin/MediaController.php
private function allMediaFiles(string $media_folder, string $subfolders): array
    {
        $query = DB::table('media_file')
            ->join('gedcom_setting', 'gedcom_id', '=', 'm_file')
            ->where('setting_name', '=', 'MEDIA_DIRECTORY')
            ->where('multimedia_file_refn', 'LIKE', '%/%')
            ->where('multimedia_file_refn', 'NOT LIKE', 'http://%')
            ->where('multimedia_file_refn', 'NOT LIKE', 'https://%')
            ->where(DB::raw('setting_value || multimedia_file_refn'), 'LIKE', $media_folder . '%')
            ->select(DB::raw('setting_value || multimedia_file_refn AS path'))
            ->orderBy(DB::raw('setting_value || multimedia_file_refn'));

        if ($subfolders === 'exclude') {
            $query->where(DB::raw('setting_value || multimedia_file_refn'), 'NOT LIKE', $media_folder . '%/%');
        }

        return $query->pluck('path')->all();
    }
private function allMediaFiles(string $media_folder, string $subfolders): array
    {
        $query = DB::table('media_file')
            ->join('gedcom_setting', 'gedcom_id', '=', 'm_file')
            ->where('setting_name', '=', 'MEDIA_DIRECTORY')
            ->where('multimedia_file_refn', 'LIKE', '%/%')
            ->where('multimedia_file_refn', 'NOT LIKE', 'http://%')
            ->where('multimedia_file_refn', 'NOT LIKE', 'https://%')
            ->where(DB::raw('setting_value || multimedia_file_refn'), 'LIKE', $media_folder . '%')
            ->select(DB::raw('setting_value || multimedia_file_refn AS path'))
            ->orderBy(DB::raw('setting_value || multimedia_file_refn'));

        if ($subfolders === 'exclude') {
            $query->where(DB::raw('setting_value || multimedia_file_refn'), 'NOT LIKE', $media_folder . '%/%');
        }

        return $query->pluck('path')->all();
    }
private function allMediaFiles ( string $ media_folder , string $ subfolders ) : array { $ query = DB :: table ( 'media_file' ) -> join ( 'gedcom_setting' , 'gedcom_id' , '=' , 'm_file' ) -> where ( 'setting_name' , '=' , 'MEDIA_DIRECTORY' ) -> where ( 'multimedia_file_refn' , 'LIKE' , '%/%' ) -> where ( 'multimedia_file_refn' , 'NOT LIKE' , 'http://%' ) -> where ( 'multimedia_file_refn' , 'NOT LIKE' , 'https://%' ) -> where ( DB :: raw ( 'setting_value || multimedia_file_refn' ) , 'LIKE' , $ media_folder . '%' ) -> select ( DB :: raw ( 'setting_value || multimedia_file_refn AS path' ) ) -> orderBy ( DB :: raw ( 'setting_value || multimedia_file_refn' ) ) ; if ( $ subfolders === 'exclude' ) { $ query -> where ( DB :: raw ( 'setting_value || multimedia_file_refn' ) , 'NOT LIKE' , $ media_folder . '%/%' ) ; } return $ query -> pluck ( 'path' ) -> all ( ) ; }
Fetch a list of all files on in the database.

@param string $media_folder
@param string $subfolders

@return string[]
Fetch a list of all files on in the database .