laravel - Laravel pluck with paginate
问题描述
So, I've a ERM with two database connected in a same laravel app. I'm trying to pull up all the IDs with pluck which is working fine but not being able to paginate. For an instance,
$newsTagSaved = NewsTag::latest()->pluck('post_id');
This works just as fine. But this pulls up way more information than I need. I'm looking for something like:
->pluck('id')->paginate(12);
This way I'm not loading data in ajax that I don't need since it will query unnecessary data on every ajax call.
Thank you!
解决方案
推荐阅读
- python - Apimatic Python SDK 返回 ModuleNotFoundError
- ruby-on-rails - 带有 where 子句和 order by 的 Rails 表
- ssl - 使用 Fineuploader 通过 SSL/HTTPS 将文件上传到 S3
- jquery - 使用 jQuery 上传文件:空的 FormData 值
- c - C 到 Rust 并返回 Rust 端的“未分配指针”
- ruby-on-rails - 试图结合 will_paginate gem 和 pg_search gem
- c# - XmlReader 内存泄漏 .Net Core 2.0
- python - 修复程序的“全局”问题?
- vtk - VTK + Qt 中未显示 3D 体积
- vba - 表达式中的当前年份加 1