Laravel
I needed to display only the first picture from my Product's model media collection and found my app running five queries and hydrating 16 models with only four products to display 😱 . Here's how I ended with only two queries and eight models.
Product
Laravel provides great functionality for working with uploaded files. But what happens when you need to upload a file from a url rather than from a user's computer? I turns out to be pretty simple.
Ever needed to apply filters on a query conditionally, only when the user actually applies them? Laravel query builder's method when got you covered.
when
PHP
From time to time I find myself in need of invoking private / protected methods, especially when writing unit tests, So I wrote a little helper to handle those situations.