PHP Versions Stats - 2021.1 Edition
Jordi is back with another post containing interesting statistics around PHP usage.
Read more [blog.packagist.com]
Jordi is back with another post containing interesting statistics around PHP usage.
Read more [blog.packagist.com]
– www.tonysm.com - submitted by Tony Messias – Edit
Tony Messias explains this design pattern using a cool example.
Read more [www.tonysm.com]
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.
"If you are one of the *millions* who have downloaded a Spatie package, then you understand the quality that Freek aims for. The newsletter is of the same quality of any Spatie package you're using."
by Freek Van der Herten – 1 minute read – Edit
You can make your code more readable by moving all your exception messages to dedicated classes. We using this technique in all our projects and packages.
by Freek Van der Herten – 2 minute read – Edit
Out of the box, Laravel comes with the ability to generate "signed" URLs. These URLs have a hash in their query string that verifies that the URL was not modified.
At Flare, we use these signed URLs to add action links in mail notifications. The action links allow users to snooze and resolve errors right from the mail without having to be logged in. Pretty convenient!
My buddy Dries Vints noticed a slight drawback. He got a mail from Flare that contains these action links. A few hours after the mail arrived, he clicked one of the action links. This is what he saw.
by Freek Van der Herten – 3 minute read – Edit
Laravel's awesome closure based routing was probably one of the first features I fell in love with. I take it for granted now, but back in the days, such a simple way of adding a route felt like a glass of water in hell compared to the other frameworks.
Typically, you would only add routes that are necessary for the users of your app. Something that I have been doing for a long time is to create a routes file, called dev.php, with routes that can help with app development.
PHP is a fantastic language that has seen many cool improvements over the past few years. What you may not be aware of is that only a very few people can work on the language itself. This is obviously not healthy and hopefully this situation will improve in the future.
Read more [blog.krakjoe.ninja]
by Freek Van der Herten – 1 minute read – Edit
by Freek Van der Herten – 1 minute read – Edit
In this stream my colleague Brent and I continued our conversation about the foundations of event sourcing. This time we showed a shopping cart that we've built using Laravel and event sourcing.
If you're interested in learning more about event sourcing, be sure to check out our upcoming course on using event sourcing in Laravel.
by Freek Van der Herten – 1 minute read – Edit
Our team released a new package called spatie/fork. Using this package you can easily execute multiple pieces of code concurrently.
PHP has several over 30 functions at the moment that make use of special OPCodes or otherwise inlined to improve performance.
Read more [php.watch]
by Freek Van der Herten – 2 minute read – Edit
I'm proud to announce yet another package by our team: spatie/laravel-interacts-with-payload. This one, which was inspired by a blog post by James Brooks, can inject data in all your jobs with just one line of code.
In this video, you'll see the package in action, I explain the internals and the tests. If you prefer reading, continue below the video.
by Freek Van der Herten – 1 minute read – Edit
Our test-time package makes writing tests, for code that makes its decisions based on the current time, very easy.
Here's how we use the package for some tests in Mailcoach.
– Edit
My colleague Brent and I are currently preparing a premium course on event sourcing in Laravel. In this stream, we explained the foundations, shared some thoughs on some of the concept, and answered questions from the audience.
by Alex Vanderbist and Freek Van der Herten – 3 minute read – Edit
I'm proud to announce that our team has released a new package called spatie/laravel-stats. This package is a lightweight solution for summarizing changes in your database over time.
The Queue class contains a method named createPayloadUsing which allows you to register a callback that is executed when creating job payloads.
Read more [james.brooks.page]
– stitcher.io – Edit
Event sourcing is about storing changes, instead of their result. It's those changes that make up the final state of a project.
Read more [stitcher.io]
– Edit
YouTube star Povilas Korop shares and discusses five rules from our guidelines.
by Brent Roose and Freek Van der Herten – 4 minute read – Edit
We've released a new major version of spatie/data-transfer-object. This package makes it easy to create objects that have a certain shape. Properties can even be validated.
🐘 Need self-validating PHP objects? Here you go!https://t.co/osPCSr0qu8
— Freek Van der Herten 🎆 (@freekmurze) April 2, 2021
Gotta love PHP 8
Very nice work by @brendt_gd pic.twitter.com/Sn1mS7R8Sv
In this post I'd like to tell you more the package.
by Freek Van der Herten – 7 minute read – Edit
When you cancel a long-running artisan command with Ctrl+C, a SIGINT signal is sent by the operating system to the PHP process. You can use this signal to perform some cleanup quickly.
Symfony 5.2 introduced support for handling signals in commands.
We've released a package called spatie/laravel-signal-aware-commands that provides a substantial improvement to how you can use these signals in a Laravel app. In this blog post, I'd like to tell you all about it.
by Freek Van der Herten – 1 minute read – Edit
In this stream, you'll see me lay the foundations for the spatie/laravel-signal-aware-command package.