From f51c5bd587947962f1c85cdc0a011304c9e5753c Mon Sep 17 00:00:00 2001 From: Pawel Bieszczad Date: Mon, 29 Aug 2022 15:48:00 -0400 Subject: [PATCH] PHP 8.1 Support Backport for https://github.com/spatie/laravel-query-builder/pull/742 & https://github.com/spatie/laravel-query-builder/pull/702 --- src/QueryBuilderRequest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/QueryBuilderRequest.php b/src/QueryBuilderRequest.php index 059d0a4a..6a5d8adb 100644 --- a/src/QueryBuilderRequest.php +++ b/src/QueryBuilderRequest.php @@ -38,7 +38,7 @@ public function includes(): Collection $includeParts = $this->getRequestData($includeParameterName); - if (! is_array($includeParts)) { + if (is_string($includeParts)) { $includeParts = explode(static::getIncludesArrayValueDelimiter(), $this->getRequestData($includeParameterName)); } @@ -53,7 +53,7 @@ public function appends(): Collection $appendParts = $this->getRequestData($appendParameterName); - if (! is_array($appendParts)) { + if (! is_array($appendParts) && ! is_null($appendParts)) { $appendParts = explode(static::getAppendsArrayValueDelimiter(), $appendParts); }