mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-19 08:32:14 +00:00
namespaces refactoring part 3
This commit is contained in:
@@ -258,9 +258,12 @@ if (! function_exists('get_item')) {
|
||||
*/
|
||||
function get_item($type, $id)
|
||||
{
|
||||
$model = strtolower($type) === 'folder' ? 'Folder' : 'File';
|
||||
$namespace = match ($type) {
|
||||
'folder' => 'Domain\\Folders\\Models\\Folder',
|
||||
'file' => 'Domain\\Files\\Models\\File',
|
||||
};
|
||||
|
||||
return ("App\\Models\\$model")::find($id);
|
||||
return ($namespace)::find($id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user