Skip to content

Commit

Permalink
Update Cursor.php (#37458)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MostafaRabia authored May 24, 2021
1 parent d6831e9 commit d456f60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Pagination/Cursor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}

Expand Down

0 comments on commit d456f60

Please sign in to comment.