mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-26 02:20:39 +00:00
controller refactoring part 1
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace Domain\Folders\Controllers;
|
||||
|
||||
use Domain\Folders\Models\Folder;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class NavigationFolderTreeController
|
||||
{
|
||||
public function __invoke(): array
|
||||
{
|
||||
$folders = Folder::with('folders:id,parent_id,id,name')
|
||||
->where('parent_id', null)
|
||||
->where('user_id', Auth::id())
|
||||
->sortable()
|
||||
->get(['id', 'parent_id', 'id', 'name']);
|
||||
|
||||
return [
|
||||
[
|
||||
'name' => __t('home'),
|
||||
'location' => 'base',
|
||||
'folders' => $folders,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user