-
Laravel (5.2) query builder has a
whenmethod laravel.com/docs/5.2/queries#conditional-statements rbbl.ws/shr/16/9FQ7G3RQD7.png -
The ‘if’ query builder macro at the bottom of this article is pretty useful too themsaid.github.io/laravel-query-conditions-20160425/