1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 05:14:04 +00:00
laravel-tips/content/tips/yesterday-in-my-at-laracononline-talk-i-explained-how-to-use-the-query-builder-when-method-to-handle-complex-sorting.md
2021-04-07 20:16:47 +02:00

12 lines
No EOL
598 B
Markdown

---
title: 'Yesterday in my @LaraconOnline talk I explained how to use the query builder when() method to handle complex sorting'
tweet_id: '1233017064492761088'
thread_slug: 1-rt-1-tip
author_username: reinink
images:
- 'https://pbs.twimg.com/media/ERyNRSIX0AEjjWo.jpg'
created_at: 2020-02-27T13:12:31+00:00
slug: yesterday-in-my-at-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. 🤩