Replace Conditional with Polymorphism

If you've ever done any research into refactoring, or programming in general, you've most likely heard the term "polymorphism". When I first came across it, I have to admit, I was intimidated. Now that I've become more familiar with the concept, I can assure you, the word itself is more complicated than the underlying principle!

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