Laravel's Stringable class turns nested PHP string functions into a readable left-to-right chain. Here are the methods worth committing to memory.
#clean-code
Articles
Stop wrapping query builder calls in if statements. The when() and unless() methods let you apply constraints conditionally while keeping the chain fluent.
Two small Laravel features, the tap() helper and higher-order collection messages, quietly remove a surprising amount of boilerplate from everyday code.