From 10f62262fa1b701bbb4708fe148251a0503ef5eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Gavrilovi=C4=87?= Date: Thu, 27 Jul 2023 10:44:52 +0200 Subject: [PATCH] stop passing null values to explode() (#179) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miloš Gavrilović --- src/Tags.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Tags.php b/src/Tags.php index 75ab272..b30dd5c 100644 --- a/src/Tags.php +++ b/src/Tags.php @@ -109,8 +109,7 @@ public function limit(?int $limit) protected function fillAttributeFromRequest(NovaRequest $request, $requestAttribute, $model, $attribute) { $requestValue = $request[$requestAttribute]; - $tagNames = explode('-----', $requestValue); - $tagNames = array_filter($tagNames); + $tagNames = is_null($requestValue) ? [] : array_filter(explode('-----', $requestValue)); $class = get_class($model);