Partial model updates in Laravel

March 27th, 2017

From time to time, I will need to perform a PATCH-style - or partial - update of a model via a HTTP request. The first instinct for this might be to use a bunch of conditionals, but there's a simpler way: intersect!

Single action controllers in Laravel

February 24th, 2017

Many Laravel applications will typically follow a RESTful structure, but sometimes, you just want to have a controller responsible for a single action. This is easier than you think.

Environment variables, config caching, and Laravel

February 6th, 2017

If you've ever used Laravel's environment-specific configuration in your application and found it not working after caching the configuration, read on to find out why this is the case.

Switching PHP versions with Laravel Valet

January 18th, 2017

Switching PHP versions when using Laravel Valet is simple with just two brew commands.

Review: Laravel up and Running by Matt Stauffer

December 15th, 2016

Matt Stauffer has released far and away the most comprehensive and accurate book on Laravel development to date - and it shouldn't show its age over time, either!

On the Laravel Certification Program

September 2nd, 2016

The Laravel Certification Program was announced at the end of the Laracon EU 2016 conference and got me excited about the possibilities, but I've thought more about it since then. I'm not entirely convinced.

Better handling of TokenMismatchException in Laravel

July 24th, 2016

Have you ever seen your errors filling up with TokenMismatchException errors for routes that don't support POST, or just don't exist? Here's one way to handle the exception better.

Review: Adam Wathan's Refactoring to Collections

June 20th, 2016

Adam Wathan has been a big proponent of Collection pipelines, so much so that he wrote a book on it, which I've had a chance to read (and think you should, too)

Configuring per-environment logging in Laravel 5

June 4th, 2016

Development often leads to adding debug logging to your application, but it's a pain to remove it all before deploying to production. Here's how to work around that.

Testing JSON APIs with Laravel 5

May 22nd, 2016

Testing for JSON responses in Laravel is easy with seeJson, but testing validation errors requires a little bit more work.