Skip to content

Commit

Permalink
fix incompatibility issue with nova 3.18
Browse files Browse the repository at this point in the history
  • Loading branch information
hello-liang-shan authored and milewski committed Dec 29, 2020
1 parent 94e92d2 commit 8ceff73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/HasMegaFilterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private function getFilterState(NovaRequest $request, MegaFilter $card): Collect

$filterDecoder = (new FilterDecoder($request->get('filters')))->decodeFromBase64String();

$value = collect($filterDecoder)->collapse()->first(fn($value, $key) => $key === MegaFilterColumns::class);
$value = collect($filterDecoder)->first(fn($filter) => $filter[ 'class' ] === MegaFilterColumns::class)[ 'value' ];

$attributes = $card->columns()->filter(static function (Column $column) use ($value) {

Expand All @@ -134,7 +134,7 @@ private function getFilterState(NovaRequest $request, MegaFilter $card): Collect

}

if ((is_bool($value = $value[ $column->attribute ] ?? true))) {
if (is_array($value) && is_bool($value = $value[ $column->attribute ])) {

return $value;

Expand Down

0 comments on commit 8ceff73

Please sign in to comment.