๐Ÿ”ฅ Weekly thread #12 of 2022

๐Ÿ”ฅ This week's code tips for Laravel developers

A weekly thread ๐Ÿงต

You can generate a series of dates in a given range right at the database level

9

๐Ÿ”ฅ You can generate a series of dates in a given range right at the database level

You can generate a series of dates in a given range right at the database level

โšก๏ธ Database Tip

When doing statistical aggregations by time, you may have gaps in your data. You don't have to fill them manually with code! You can generate a series of dates from a start to end time and use these days to join to your statistical data with gaps.

You can debounce a function using Alpine.debounce()

7

๐Ÿ”ฅ You can debounce a function using Alpine.debounce()

โ“ Using Alpine.js and need to debounce a function?

โŒ You don't need JavaScript libraries like lodash.

โœ… Just use Alpine.debounce() which is also used internally for the x-on:input.debounce="" modifier.

Cc: @calebporzio

You can record all login & logout events

3

๐Ÿ”ฅ You can record all login & logout events

You can record all login & logout events

๐Ÿ”ฅ #Laravel Tip: If your app needs to record logins and logouts for security purposes (auditing), then you should definitely make use of the auth events, which allow you to easily listen for them.

We're writing a book, you can get it for free here.