Determining the start of the next business day in Oh Dear original
When a site is down, Oh Dear sends a notification every hour. Since last year, our notifications can be snoozed for a fixed amount of time (5 minutes, 1 hour, 4 hours, one day).
In the evenings and weekends, our users might not want to receive repeated notifications. That's why we've added a nice human touch: all notifications can now be snoozed until the start of the next workday.
In this blog post, I'd like to share some of the code that powers this feature. We'll focus on how the start of the next workday is calculated.
Join 9,500+ smart developers
Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
No spam. Unsubscribe anytime. You can also follow me on X.
"Always fresh, useful tips and articles. Carefully selected community content. My favorite newsletter, which I look forward to every time."
PHP-Doc in Blade-Views
– gummibeer.dev - submitted by Tom Witkowski
How to use PHP-doc tags for better autocompletion in Blade views.
Read more [gummibeer.dev]
Setup MailHog with Laravel Valet
– ryangjchandler.co.uk - submitted by Ryan Chandler
Testing emails can be a pain. Luckily, there are plenty of tools out there that can make the process a lot easier. Let me show you how to setup MailHog, a local development tool for testing emails.
Read more [ryangjchandler.co.uk]
Generate HTTPS URLs when running Laravel behind a proxy
– michielkempen.com - submitted by Michiel Kempen
What is the TrustProxies middleware and how can it help you generate secure HTTPS URLs, even when running Laravel behind a proxy?
Read more [michielkempen.com]
Dealing with failed jobs
– luisdalmolin.dev - submitted by Luis Dalmolin
Blog post with some practical tips on how to deal with failing and failed jobs.
Read more [luisdalmolin.dev]
Cold Starts in AWS Lambda
Mikhail Shilkov explains what cold starts are and discusses some interesting benchmarks.
This article describes AWS Lambda—the dynamically scaled and billed-per-execution compute service. Instances of Lambdas are added and removed dynamically. When a new instance handles its first request, the response time increases, which is called a cold start.
Read more [mikhail.io]
When to add types and when to infer in TypeScript
This is how Seb decides when or when not to explicitly add types in TypeScript.
Read more [sebastiandedeyne.com]
Using composer patches
When you use software that is open source, you'll sometimes run into issues or small bugs that have already been fixed by the community in a PR or an issue, but have yet to be merged and/or released. If you're impatient and need that fix now, composer patches can be a solution for this problem.
Read more [www.rias.be]
Full-Text Search with MeiliSearch and Laravel Scout
MeiliSearch is a simple self-hosted full-text search solution that's easy to integrate into a Laravel application–their team even maintains a Laravel Scout driver!
Read more [tighten.co]
Using macros with Blade component attributes
💡 Advanced @laravelphp tip!
— Pascal Baljet (@pascalbaljet) February 3, 2021
If you're using the $attributes variable in a Blade Component, you're using the ComponentAttributeBag class, which is macroable 😏
I wrote a macro to dynamically toggle classes by accepting an array, just like v-bind:class in Vue.js! #Laravel #PHP pic.twitter.com/Uis7hykv20
Read more [twitter.com]
Route based modals with Laravel, Inertia.js and Vue.js
– larsklopstra.nl - submitted by Lars Klopstra
Modals can be a pain in the ass, but there's no way around them. I'm currently working on an application where we need them. Whilst working with Inertia.js and Vue.js we have many options available, let's have a look how I solved this issue.
Read more [larsklopstra.nl]
How to post to Twitter from your Laravel app using Zapier
– mattstauffer.com - submitted by Jamison Valenta
This tutorial walks through how to set up your Laravel application to use Zapier to post tweets.
Read more [mattstauffer.com]
Making our Laravel test suite in Oh Dear ready for parallel testing
Using the new parallel testing feature that recently landed in Laravel, we managed to run the Oh Dear testsuite about four times faster.
Read more [ohdear.app]
Display real-time progress of batched jobs using Livewire
Using @LaravelLivewire it is incredibly easy to display real-time progress of batched jobs! 🔥
— Willem Leuverink (@gwleuverink) January 18, 2021
Just drop in this simple trait & blade component and you're off to the races #hottip pic.twitter.com/I6K1zalzeJ
Read more [twitter.com]
What's new in PHP 8.1
– stitcher.io - submitted by Brent
PHP 8.1 is currently in active development and will probably be released somewhere around the end of November 2021. We already know some features, changes and deprecations, so let's go through them one by one.
Read more [stitcher.io]
A mail driver to quickly preview mail in Laravel apps original
Using our laravel-mail-preview package, you can quickly display mails that are sent by your Laravel application in your browser.
Today, we've released v5 of the package. In this blog post, I'd like to tell you all about it.
How to Use Cookies With AlpineJS
– releasecandidate.dev - submitted by Peter
Here's a simple approach on how to use cookies with AlpineJS
Read more [releasecandidate.dev]
Multi-server Atomic Laravel Deployments with GitHub Actions
Learn how to deploy your Laravel application without any down-time using Github Actions. This technique works for almost any application (Symfony, WordPress, you name it).
Read more [philo.dev]
Contract Tests
In this post, Kai takes a look at how you can write tests to ensure consistent behavior across all implementations of an interface.
Read more [www.kai-sassnowski.com]