We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e79095 commit 1386ad7Copy full SHA for 1386ad7
src/Pagination/Cursor/CursorParser.php
@@ -32,12 +32,13 @@ public function __construct(private IdParser $idParser, private string $keyName)
32
*/
33
public function encode(LaravelCursor $cursor): string
34
{
35
- $key = $cursor->parameter($this->keyName);
36
-
37
- if ($key) {
+ try {
+ $key = $cursor->parameter($this->keyName);
38
$parameters = $this->withoutPrivate($cursor->toArray());
39
$parameters[$this->keyName] = $this->idParser->encode($key);
40
$cursor = new LaravelCursor($parameters, $cursor->pointsToNextItems());
+ } catch (\UnexpectedValueException $ex) {
41
+ // Do nothing as the cursor does not contain the key.
42
}
43
44
return $cursor->encode();
0 commit comments