I'm wondering if there's a way to retrieve a set of models, then search that set without hitting the database.
For example, I have a Request model with a one-to-many relationship with a File model, called "Files". For my action, I need to both have the full list of all File models associated, but I also want to be able to search that list to see if any of them have a particular filename.
If I call getFiles() multiple times, once with my condition and once without, the database gets hit twice - less than ideal. I know I can use getFiles()->filter(), and it looks like that's the way I'll go, but I was simply wondering if there was another, more appropriate way to accomplish what I need.