Answer the question
In order to leave comments, you need to log in
Request to Eloquent. How to select 4 latest entries from each category?
There is, for example, a table posts
, it has records with fields id, title, category_id, created_at
, (each record can belong to one category category_id)
I can’t figure out how to write a query to pull the posts
last four records from each category from the table ... as I understand it like that need to group them
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question