How can I get part of posts ordered by updated_at and other part by created_at with pagination
Hi!
How can I get part of the posts ordered by updated_at and another part by created_at with pagination?
For example: have 20 posts and I need to show on page 10 posts where 5 posts order by created_at and 5 posts order by updated_at.
@Shivamyadav No, I want to get two parts of posts on every pagination page - first part is ordered by created_at and the second ordered by updated_at. Totally for example 10 posts on page which 5 are ordered by created_at and 5 are ordered by updated_at.
@vincent15000 I have posts (for example 100 posts in the table) and I need to show these posts (10 per page) using pagination (it can be not only native laravel pagination, maybe using method skip). The First 5 posts are ordered by created_at and the other 5 posts are ordered by updated_at on every page.
@vincent15000 Yes, cool idea, but it's just ordered only 10 retrieved posts on page. In this case in table can be a post which have more latest created_at or updated_at