Skip to content

Commit

Permalink
fix relationSearch
Browse files Browse the repository at this point in the history
  • Loading branch information
luanfreitasdev committed Aug 11, 2021
1 parent 2362659 commit 28a8407
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/PowerGridComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,11 @@ public function exportToCsv(): BinaryFileResponse
->download();
}

public function relationSearch(): array
{
return [];
}

private function loadData()
{
if (cache()->has($this->id)) {
Expand Down Expand Up @@ -386,9 +391,15 @@ private function loadData()
return $results->setCollection($this->transform($results->getCollection()));
}

private function instanceOfCollection($dataSource): bool
private function instanceOfCollection($dataSource): void
{
return (is_a($dataSource, PowerGrid::class) || is_array($dataSource) || is_a($dataSource, BaseCollection::class));
$checkDatasource = (is_a($dataSource, PowerGrid::class)
|| is_array($dataSource)
|| is_a($dataSource, BaseCollection::class)
);
if ($checkDatasource) {
$this->isCollection = true;
}
}

private function transform($results)
Expand Down

0 comments on commit 28a8407

Please sign in to comment.