Skip to content

Commit

Permalink
use resource collection
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Oct 14, 2024
1 parent b18a0e9 commit fde472c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/Http/Controllers/CP/Assets/BrowserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Illuminate\Pagination\Paginator;
use Statamic\Contracts\Assets\AssetContainer as AssetContainerContract;
use Statamic\Exceptions\AuthorizationException;
use Statamic\Facades\Action;
use Statamic\Facades\Asset;
use Statamic\Facades\Scope;
use Statamic\Facades\User;
Expand Down Expand Up @@ -113,14 +112,7 @@ public function folder(Request $request, $container, $path = '/')
'data' => [
'assets' => FolderAsset::collection($assets ?? collect())->resolve(),
'folder' => array_merge((new Folder($folder))->resolve(), [
'folders' => $folders->values()->map(function ($folder) use ($container) {
return array_merge($folder->toArray(), [
'actions' => Action::for($folder, [
'container' => $container->handle(),
'folder' => $folder->path(),
]),
]);
}),
'folders' => Folder::collection($folders->values()),
]),
],
'links' => [
Expand Down

0 comments on commit fde472c

Please sign in to comment.