Skip to content

Commit 8e01b81

Browse files
committed
fix: Fix anonymous resource collection data formatting
1 parent ad60c4a commit 8e01b81

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ApiResourceDataTable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public function __construct(AnonymousResourceCollection $collection)
3737
{
3838
$this->request = app('datatables.request');
3939
$this->config = app('datatables.config');
40-
$this->collection = collect($collection);
41-
$this->original = collect($collection);
42-
$this->columns = array_keys($this->serialize(collect($collection)->first()));
40+
$this->collection = collect($collection)->pluck('resource');
41+
$this->original = collect($collection)->pluck('resource');
42+
$this->columns = array_keys($this->serialize(collect($collection)->pluck('resource')->first()));
4343
}
4444
}

0 commit comments

Comments
 (0)