mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 00:02:15 +00:00
frontend function consolidation part 2
This commit is contained in:
@@ -218,7 +218,9 @@ function is_demo($user_id)
|
||||
*/
|
||||
function get_item($type, $id)
|
||||
{
|
||||
return ('App\\Models\\' . ucfirst($type))::find($id);
|
||||
$model = strtolower($type) === 'folder' ? 'Folder' : 'File';
|
||||
|
||||
return ("App\\Models\\$model")::find($id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -756,6 +758,7 @@ function get_files_for_zip($folders, $files, $path = [])
|
||||
$files->push([
|
||||
'name' => $file->name,
|
||||
'basename' => $file->basename,
|
||||
'mimetype' => $file->mimetype,
|
||||
'folder_path' => implode('/', $path),
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user