I have table of dogs in my DB and I want to retrieve N latest added dogs.
N latest added dogs
Only way that I found is something like this:
Do
You can pass a negative integer n to take the last n elements.
Dogs::all()->take(-5)
This is good because you don't use orderBy which is bad when you have a big table.