Every two weeks I send out a newsletter containing lots of interesting stuff for the modern PHP developer.
Expect quick tips & tricks, interesting tutorials, opinions and packages. Because I work with Laravel every day there is an emphasis on that framework.
Rest assured that I will only use your email address to send you the newsletter and will not use it for any other purposes.
Earlier this year we released v2 of laravel-event-sourcing. This package is probably the easiest way to getting started with event sourcing in Laravel. A significant feature of v2 was the addition of aggregates.
Today we released another new version of the package that adds test methods. These methods allow you to verify if the aggregate behaves correctly. In this post, I'll show you an example and explain how the test methods are implemented.
Jason McCreary, creator of Laravel Shift, wrote a post mortem on a problem where too many mails were sent.
It was 7:07 am. I woke up to 56 emails, 17 tweets, 9 Slack messages, and 4 telegrams. All of which alerting me my SaSS product had sent 3,625 email messages to 1,544 users overnight. I am Jack's cold sweat. 😅
Read more [jasonmccreary.me]
Matthew Rocklin reminds us that sometimes you shouldn't extract code.
However, there is also a cost to this behavior. When a new reader encounters this code, they need to jump between many function definitions in many files. This non-linear reading process requires more mental focus than reading linear code.
Read more [matthewrocklin.com]
Nicolas Beauvais wrote a nice blogpost on how he went about adding support for internationalization to his app.
When working on web applications, translation strings are typically stored in the backend of your app while they’re mostly used in the frontend. This is the main challenge because you need to communicate the translations from your backend to your frontend code.
Read more [nicolas-beauvais.com]
At the Oh Dear blog, my colleague Mattias explains how to use our service to verify that your site is still online after a deploy.
You can use our API to trigger an on demand run of both the uptime check and the broken links checker. If you add this to, say, your deploy script, you can have near-instant validation that your deploy succeeded and didn't break any links & pages.
Read more [ohdear.app]
Some wise words by Mathias Verraes
We must remember to think of a design pattern as “a problem in a context with a reusable solution”, not merely “a reusable solution”. If two patterns have identical solutions, we should not think of them as the same pattern.
Read more [verraes.net]
Jason McCreary wrote an epic blogpost on how to get started with tests in a Laravel app. I wish I could have read this when I started out with testing.
This brings me to the next common response, we don’t know where to start testing. This comes in two forms. The first form is quite literally we don’t know which test to write first. The second form is more not knowing how to write the first test. ... Today, I want to focus on getting started with testing your Laravel applications.
Read more [jasonmccreary.me]
A few weeks ago, my colleague Seb added webmentions to his blog.
I first noticed webmentions in the wild on Hidde de Vries’ blog about two years ago. Last week it finally happened, I added webmention support to my blog too! Well, partial support at least. I’m now receiving and displaying webmentions. Sending them out is a project for another day.
Read more [sebastiandedeyne.com]
Our team releases a lot of open source packages. All of our packages are well documented. For the smaller packages, we use a simple readme on GitHub. The bigger packages, like medialibrary and event projector get documented on our documentation site. We recently moved our site from a Digital Ocean…
Tim MacDonald, a freelance software developer based in Sydney, investigates how to make Laravel tests run faster. Turns out you a lot can be gained by caching the config.
I saw a conversation on Twitter the other day discussing how Laravel was slowing down a test suite. I decided I wanted to dig into this and see if there was anything to it.
Read more [timacdonald.me]
Simon Kollross explains how to use our laravel-backup package to create an encrypted backup of your Laravel based app.
You should always encrypt backups of your apps and securely transfer them to one or multiple backup destinations. If you encrypt the backups on your server and transfer only the encrypted version, your backups are stored encrypted at rest in your backup destination. Not even your backup storage provider is able to read them.
Read more [simonkollross.de]
Recently Jeffrey Way published a video titled "Frontend Authorization Brainstorming" on Laracasts. In that video, he shows three ways of passing authorization results to the front-end.
Currently I'm working on a big project that uses Inertia, React and TypeScript. In this blog post, I won't cover those things in detail, but I'd like to show you have we, using those technologies, pass authorization (and routes) to the front-end.
A nice insight by Basecamp engineer Jonas Downey.
Whatever ownership you have over an individual contribution is immediately forfeited the moment you commit the code. At that moment, the work becomes part of the ever-evolving organism that comprises a software system.
Read more [m.signalvnoise.com]