Chaps
2643
12
Laravel

Help please? How to get the last 10 rows of a table?

Posted 2 years ago by Chaps

Help please? I've created a live chat using vue2, how to get the last 10 rows of a table?

please see my query, thanks!

$chatMessage = ChatMessage::with('user.role')
                              ->limit(10)
                              ->get();

return $chatMessage;

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.