From 78fc5ba888b82435e057e0311db2c05263031a0e Mon Sep 17 00:00:00 2001 From: MostafaRabia Date: Sun, 23 May 2021 10:02:19 +0200 Subject: [PATCH] Update Cursor.php Order by column that can be null given me "Unable to find parameter [last_answer] in pagination item.". I solved it by this change and make 2 orders by, first is the id that won't be null, second is "last_answer" that can be null, and worked. --- src/Illuminate/Pagination/Cursor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Pagination/Cursor.php b/src/Illuminate/Pagination/Cursor.php index c95709537fea..e8edf6526bc8 100644 --- a/src/Illuminate/Pagination/Cursor.php +++ b/src/Illuminate/Pagination/Cursor.php @@ -43,7 +43,7 @@ public function __construct(array $parameters, $pointsToNextItems = true) */ public function parameter(string $parameterName) { - if (! isset($this->parameters[$parameterName])) { + if (! array_key_exists($parameterName, $this->parameters)) { throw new UnexpectedValueException("Unable to find parameter [{$parameterName}] in pagination item."); }