Skip to content

Commit 28a8407

Browse files
fix relationSearch
1 parent 2362659 commit 28a8407

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/PowerGridComponent.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,11 @@ public function exportToCsv(): BinaryFileResponse
331331
->download();
332332
}
333333

334+
public function relationSearch(): array
335+
{
336+
return [];
337+
}
338+
334339
private function loadData()
335340
{
336341
if (cache()->has($this->id)) {
@@ -386,9 +391,15 @@ private function loadData()
386391
return $results->setCollection($this->transform($results->getCollection()));
387392
}
388393

389-
private function instanceOfCollection($dataSource): bool
394+
private function instanceOfCollection($dataSource): void
390395
{
391-
return (is_a($dataSource, PowerGrid::class) || is_array($dataSource) || is_a($dataSource, BaseCollection::class));
396+
$checkDatasource = (is_a($dataSource, PowerGrid::class)
397+
|| is_array($dataSource)
398+
|| is_a($dataSource, BaseCollection::class)
399+
);
400+
if ($checkDatasource) {
401+
$this->isCollection = true;
402+
}
392403
}
393404

394405
private function transform($results)

0 commit comments

Comments
 (0)