11.08.2017 Views

codebright

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Eloquent Queries 283<br />

I don’t believe you. If it doesn’t return an array then how did we loop through the<br />

results?<br />

That’s simple. The Collection object implements an interface which allows for the object to be<br />

iterable. It can be looped through using the same functionality as standard PHP arrays.<br />

Hmm, I see. I’m not going to take the word of a lier so easily, though.<br />

Ah I see, you require additional proof? Let’s dump the $albums attribute to see what we are working<br />

with. This should do the trick.<br />

1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!