Skip to content

Commit

Permalink
Fix color enum dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
miguilimzero committed Aug 6, 2023
1 parent 6dee5f0 commit 807b95e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Generators/TableGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ protected function getResourceTableSchema(array $visibleColumns, array $searchab
$columnInstance->colors(function($state) use($enumDictionary, $key) {
$dictionary = $enumDictionary[$key];

return $dictionary[$state][1] ?? null;
if (! is_array($dictionary[$state]) || ! array_key_exists(1, $dictionary[$state])) {
return null;
}

return $dictionary[$state][1];
});
}

Expand Down Expand Up @@ -200,6 +204,6 @@ protected function bindRelatedResourceToRelationship(TextColumn $column): TextCo
}

return $selectedResource::getUrl($view, $relatedRecord->getKey());
});
})->color('primary');
}
}

0 comments on commit 807b95e

Please sign in to comment.