Laravel: Store query results in variable, then be able to query again using that variable
I'm facing a challenge in (wrongfully) generating a query inside a foreach loop. The problem is that Logs is being queried each time the loop runs. The code currently looks like this: $logs = Logs::query(); // This table has about…