Sorting Parent Eloquent Models by a Child Relationship

Ever needed to sort a parent Eloquent model by one of its child relationships? Here's how I do it!

Continue Reading
Written By Jesse Schutt
Posted on

Testing 101: Escape Testing Paralysis!

Learning to write good tests is critical to being a programmer. We write tests to make sure the work is solid and doing what it's supposed to, while exerting as little effort as possible (we're not lazy; we're effective...). When I understood that, I determined that I was going to get great at testing. So naturally I started internet research: "Dear Google, show me 'best code testing practices.'"

Continue Reading
Written By Jesse Schutt
Posted on

Using WhereHas in Laravel Polymorphic Relations

Have you ever needed to use a query constraint on a Laravel polymorphic relationship? Here's a method that has worked well for me!

Continue Reading
Written By Jesse Schutt
Posted on