I canβt tell you how it works behind the scenes in Laravel, as I just discovered this today. But using the debug bar, I can clearly see e. g. only 3 queries for 3 records with different ids are executed and the data inside the model properties are different for each record too, as expected.
Ah okay so I checked the code and because the backtrace of the closure is hashed the code knows when to call the closure again. Really sometimes Laravel freaks me out π
Comments