- spotlight refactoring

- subscription widget fix in admin
This commit is contained in:
Čarodej
2022-05-30 10:12:35 +02:00
parent 17d4bcd888
commit 317d7aefc3
3 changed files with 8 additions and 15 deletions

View File

@@ -96,10 +96,14 @@ class SpotlightSearchController
->get()
->take(3);
$entries = collect([
$folders ? json_decode((new FolderCollection($folders))->toJson(), true) : null,
$files ? json_decode((new FilesCollection($files))->toJson(), true) : null,
])->collapse();
// Collect folders and files to single array
return response()->json([
'folders' => new FolderCollection($folders),
'files' => new FilesCollection($files),
'data' => $entries,
]);
}
}