The magic of dedicated exception classes original
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.
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.
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.
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."
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]
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.
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]
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.
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.
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.
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]
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]
YouTube star Povilas Korop shares and discusses five rules from our guidelines.
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.
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.
In this stream, you'll see me lay the foundations for the spatie/laravel-signal-aware-command package.
A few days ago, you might have received a Dependabot security warning on Ignition concerning a remote code execution vulnarablity. This post on the Flare blog explains why most people shouldn't be effected by this.
Read more [flareapp.io]
– www.twilio.com - submitted by Nuno Maduro
In this tutorial, we’ll be looking at how to get started using Pest in a Laravel project. Using the test-driven approach, we’ll be building a simple to-do application that allows you to create, edit, update and delete tasks.
Read more [www.twilio.com]