Laravel Pro Tips
💡 #Laravel Tips of the day 😎
Laravel 𝘀𝗸𝗶𝗽 𝗺𝗲𝘁𝗵𝗼𝗱 𝗶𝗻 𝘀𝗰𝗵𝗲𝗱𝘂𝗹𝗲𝗿 - We can use skip in your commands to skip an execution. #php #backend
🔥 Laravel Tip: You can specify what to do if a scheduled task fails or succeeds.
One of the nice little things we do is modify our Laravel schedule so that every command is run in the background, without overlapping.
We've got ~80 scheduled commands, so running in the background ensures they don't pile up.
🔥 #Laravel the skip method in scheduler
🔥 #Laravel Tip: The task scheduler isn’t just a place where you set a command and time. It can do so much more, like emailing output on error, or pinging urls. Check it out.
🔥 #Laravel Tip: When offering free trials, you'll end up with users that didn't convert and never deleted their accounts. Rather than keep this expired data around, configure your app to automatically purge it.
🔥 #Laravel Tip: The task scheduler is not limited to just commands. You can configure it to dispatch jobs and even execute shell scripts at regular intervals.
💡#Laravel Eloquent Tip
Laravel 8 introduced the Prunable trait. You can use it to delete old models on a scheduled basis.
You don't need to write custom commands anymore:
No articles were found.