Laravel Contributor
Exciting new for last week. I was working on some unit tests for my new ClubLaunchpad.com site. I was doing some work to determine conflict groups when members want to sign up to conflicting clubs, and each club and each member has requirements and preferences in terms of what they want.
As part of this I did some work with the Collection
class that laravel uses. It’s a fancy array()
in many
ways, and is how you would expect a result from a database call to come back. So, since database calls are
very common this is a super super core class in Laravel.
Well I had a bunch of users and wanted to alter N of them, and pass N through in a parameter so I called
$adults = $users->pop($n);
But I got weird results when $n<1
. Now it’s fair enough that you might think “Why ask it to get 0 users”,
but I did and I got 2 users back instead of zero. This lead to my first Laravel Pull request, and within 20
minutes it was accepted by Taylor Otwell who is, as far as I can tell, the main guy, when it comes to Laravel.