Yesterday in my @LaraconOnline talk I explained how to use the query builder when() method to handle complex sorting

Yesterday in my @LaraconOnline talk I explained how to use the query builder when() method to handle complex sorting

What you may not realize is that the when() method also accepts a second callback for the falsy case. This is really helpful for setting a sort default. 🤩