Posts tagged with best practices

Best Practices for Using PHP Enumerations

jeffochoa.me - submitted by Jeff

Although PHP Enumerations are meant to provide an easy and elegant solution to work with a predefined set of values, these classes are often misused, resulting in a lack of consistency due to the introduction of all sorts of methods that increase their complexity. In this article, we are going to go through some practices (both good and bad) with the goal of clarifying the understanding of these types of objects to help you build a more resilient and consistent codebase.

Read more [jeffochoa.me]

Join thousands of developers

Every two weeks, I share practical tips, tutorials, and behind-the-scenes insights from maintaining 300+ open source packages.

No spam. Unsubscribe anytime. You can also follow me on X.

Using Postmark Rebound to improve handling of bounced emails

by Freek Van der Herten – 2 minute read

Whenever Oh Dear detects something wrong with your site, it can send you a notification. We have multiple channels available: Slack, Telegram, webhooks, and many more. The most popular channel our users use is just simple mail.

Behind the scenes, Oh Dear uses Postmark to send emails. Postmark will inform us whenever a notification mail results in a hard bounce. A hard bounce means that the mail won't be delivered. The most common reason for this is that the mailbox doesn't exist (anymore). This can occur when somebody changes jobs, and the work email address no longer exists.

Read more

Strategies for making Laravel packages customizable

by Freek Van der Herten – 10 minute read

While attending Laracon India, many people approached me to ask how we handle the maintenance of all our Spatie packages. One of the ways we keep maintenance burden low is by making our packages customizable. In this blog post, I'd like to cover some of our best tips to make a Laravel package easy…

Read more