D
D
dentxt2018-08-27 17:57:13
Laravel
dentxt, 2018-08-27 17:57:13

How to display top 3 posts in Laravel?

It is necessary to display 3 records from the database that have the `hosts` field with the maximum values.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ivkol, 2018-08-27
@dentxt

...->orderBy('hosts', 'desc')->limit(3)->get();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question