Oh Dear is the all-in-one monitoring tool for your entire website. We monitor uptime, SSL certificates, broken links, scheduled tasks and more. You'll get a notifications for us when something's wrong. All that paired with a developer friendly API and kick-ass documentation. O, and you'll also be able to create a public status page under a minute. Start monitoring using our free trial now.
How to check which version of PHP you are running
When working on open source code, I like using the latest version of PHP. When developers that are not on the latest version use the package, they might see syntax errors.
You might ask why Composer doesn't protect against this? When composer.json requires the latest version, how do devs, not on the latest version, can even install the package?
Well, there seemingly are a lot of people that only upgrade the PHP version on the command line. For handling web requests, they are unknowingly using an older version of PHP. Here's how to make sure you are on the latest version of PHP on both the CLI and for handling web requests.
I write about Laravel, PHP, AI and building better software.
Every two weeks, I share practical tips, tutorials, and behind-the-scenes insights from maintaining 300+ open source packages. Join thousands of developers who read along.
No spam. Unsubscribe anytime. You can also follow me on X.
Mailcoach v2 has been released with support for custom HTML editors and multiple mailers
A couple of months ago, my team released Mailcoach, a self-hosted solution to send out newsletters. It sends out mail via services like Amazon SES, Mailgun, Sendgrid, and Postmark. It can optionally track opens and clicks. When your email list grows, this is a much more cost-effective solution when compared to a service like Mailchimp.
Mailcoach can be used as a premium Laravel package or as a stand-alone app. When installed into a Laravel app, it can be greatly customized. The Mailcoach stand alone app can be used without knowing how to program.
Today we're releasing v2 of Mailcoach. It offers support for Laravel 7, html editors, and multiple mailers, together with a bunch of quality of life improvements. In this blog post, I'd like to walk you through these features and show some technical details.
On using arrow functions in PHP 7.4
In PHP 7.4 a widely requested feature landed: arrow function. In this blogpost I'd like to show you how I like to use them.
Writing readable PHP: decrease indentation by returning early
In this short post, I'd like to give you a tip on writing readable PHP.
Explaining Laravel Queue configuration keys
Link – – divinglaravel.com
In an awesome series of video tweets, Mohammed Said explains some of the most confusing Queue configuration keys.
Read more [divinglaravel.com]
Understanding PHP 8's JIT
Link – – thephp.website
PHP 8’s Just In Time compiler is implemented as part of the Opcache extension and aims to compile some Opcodes into CPU instructions in runtime. Nickolas Da Silva explains how it works.
Read more [thephp.website]
Hosting daemon apps on Forge
Link – – assertchris.io
Christopher Pitt guides you can host daemon apps, for example Next apps, on Forge
Read more [assertchris.io]
Pass Typescript-like Typed Objects and Arrays to Your Laravel Functions by Leveraging Data Transfer Objects
Link – – github.com
Leonel Elimpe explains how you can use our DTO package.
Read more [github.com]
How to use a MySQL database on GitHub Actions
Recently we started using GitHub Actions to test all our packages. You can read more about our general setup in this blog post.
For most of the packages, this works great. However, some of our packages, such as Laravel Tags, use JSON functions that are not available in SQLite. Luckily it's straightforward to use a database like MySQL in GitHub Actions.
How we identified clients with SSL certificates affected by Let's Encrypt mass-revocation
Link – – ohdear.app
On the Oh Dear blog, Mattias Geniar shares how he found all certificates that were affected by Let's Encrypt mass revocation of SSL certificates.
Read more [ohdear.app]
Using Custom Eloquent Casts in Laravel 7
Link – – atymic.dev
Atymic explains a cool new feature in Laravel 7
Read more [atymic.dev]
Lazy Collections in Laravel Excel
Link – – stefanzweifel.io - submitted by Stefan Zweifel
Stefan Zweifel recently had to refactor an Excel export which deals with thousands of rows. Lazy Collections helped solve all performance problems.
Read more [stefanzweifel.io]
Building and Deploying with Github Actions
Link – – driesvints.com - submitted by Dries Vints
Dries Vints wrote a short piece on setting up a continuous delivery pipeline with Github Actions.
Read more [driesvints.com]
Behind the scenes of Flare (or How to structure big Laravel applications)
Typescript is changing how I write code
Link – – evertpot.com
A nice example by Evert Pot on how you can make static analysers do their work better.
Read more [evertpot.com]
How to write exceptionally good exceptions in PHP
In this video, which is part of the mailcoach video course, I show how I like to write my exceptions.
At the time of writing this post, we're running a contest where you can win a free mailcoach license.
Adding Commits to Someone Else's Pull Request
Link – – tighten.co - submitted by Matt Stauffer
When getting an open source pull request, sometimes you'll need to make a change before merging. Here's how to do that.
Read more [tighten.co]
How to refactor complex if statements
Have you every come across confusing if statements with complex conditionals such as this? I bet you did!
// please kill me 🤯
if (!(($this->shipping_country == "GB" || (strcmp($this-status, "Valid") !== 0)) {
To me, this is completely unreadable.
In the video below I show how I deal with this situation. Spoiler: add some tests around it and break the conditionals apart.
This video is part of the Mailcoach video course. It contains many more videos on how to write clear code. You can use this coupon code to get a nice discount of $10.
YES-I-WANT-TO-WRITE-READABLE-CODE
Laravel Tail can now tail remote logs
laravel-tail is one of my favourite packages. When installed in a Laravel app it can be used to tail the log file. To tail a log file locally, you just have to issue this command: php artisan tail and it'll start tailing the latest log file (so it works for both daily and single log files). Any line…