Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在为我的 api 使用 scout 所以不能使用 pagination ,因为 scout 只提供分页,所以有什么方法可以在 laravel scout 中使用偏移和限制?
你可以使用方法take()
$result = YourModel::search('query')->take(20)->raw()
或者
$result = YourModel::search('query')->take(20)->get()
https://laravel.com/docs/5.5/scout#pagination