I am trying to get the result from a database in a laravel 5 based application, and for me life cannot understand.
I want to select the top 5 DESC results from a row called count. This is what I have:
$full = Fulls::all()->orderBy('count', 'desc')->take(5)->get();
I also tried a lot, but nothing works. Now I get the error message:
FatalErrorException on line indexController.php 19: calling the undefined method Illuminate \ Database \ Eloquent \ Collection :: orderBy ()
However, wherever I look, I see people working with orderBy() , so ... what am I doing wrong?
Thanks in advance...
source share