Skip to content

Commit 636d823

Browse files
redzwanlatifstreamtw
authored andcommitted
asda
1 parent 6ac73ab commit 636d823

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Controllers/ItemsController.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,13 @@ public function getItems(Request $request)
5959
$perPage = $this->helper->getPaginationPerPage();
6060
$items = array_merge($this->lfm->folders(), $this->lfm->files());
6161

62-
var_dump($items);exit();
62+
//var_dump($items);exit();
63+
64+
$items = array_map(function ($item) {
65+
return $item->fill()->attributes;
66+
}, $items);
6367

6468
$keyword = $request->keyword;
65-
6669
if (!empty($keyword)) {
6770
$items = array_values(array_filter($items, function ($item) use ($keyword) {
6871
if ($this->like_match("%".$keyword."%", $item['name'])) {
@@ -74,9 +77,7 @@ public function getItems(Request $request)
7477
}
7578

7679
return [
77-
'items' => array_map(function ($item) {
78-
return $item->fill()->attributes;
79-
}, array_slice($items, ($currentPage - 1) * $perPage, $perPage)),
80+
'items' => array_slice($items, ($currentPage - 1) * $perPage, $perPage),
8081
'paginator' => [
8182
'current_page' => $currentPage,
8283
'total' => count($items),

0 commit comments

Comments
 (0)