Skip to content

Commit e8dbbfd

Browse files
authored
Merge pull request #92 from Chance-fyi/patch-1
Check if the `CursorPaginator::class` exists
2 parents a77eb7f + 39f00e5 commit e8dbbfd

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/support/bootstrap/LaravelDb.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,11 @@ public static function start(?Worker $worker)
113113
$page = (int)($request->input($pageName, 1));
114114
return $page > 0 ? $page : 1;
115115
});
116-
CursorPaginator::currentCursorResolver(function ($cursorName = 'cursor') {
117-
return Cursor::fromEncoded(request()->input($cursorName));
118-
});
116+
if (class_exists(CursorPaginator::class)) {
117+
CursorPaginator::currentCursorResolver(function ($cursorName = 'cursor') {
118+
return Cursor::fromEncoded(request()->input($cursorName));
119+
});
120+
}
119121
}
120122
}
121123
}

0 commit comments

Comments
 (0)