New problem, new library! This time, I made a small utility for Laravel to limit a group of models on the table.
https://github.com/Laragear/Capstone
I talked about the implementation on my Medium blog, but in a nutshell, it uses a subquery to keep only the records you don't want to delete, like the latest five.
