Cool Laravel Testing Techniques
In this stream, Brent and I showcase some cool techniques we use in our test suites.
In this section you can read posts I've written myself.
In this stream, Brent and I showcase some cool techniques we use in our test suites.
In this stream, Pest creator Nuno Maduro explains how his testing tool works under the hood.
If you want to know how to use Pest (or PHPUnit) to test your application code, consider picking up our Testing Laravel video course.
Stay up to date with all things Laravel, PHP, and JavaScript.
You can follow me on these platforms:
On all these platforms, regularly share programming tips, and what I myself have learned in ongoing projects.
Every month 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.
Whenever something happens in one of your repos on GitHub, you can configure a webhook to be sent to your app. This way, you can perform some extra logic when a particular event occurs on the repo. A silly example would be to send someone a mail when an issue is opened.
We've created a new package called spatie/laravel-github-webhooks that makes it easy to consume GitHub webhooks in a Laravel app. In this blog post, I'd like to tell you all about it.
When reading technical blogpost around the web, you might have noticed that code highlighting is not always perfect.
Shiki is the code highlighter that uses the textmate parser VSCode uses under the hood. The code highlighting it provides is near perfect, even when using modern syntax. It supports 100+ languages (via our package Blade is supported too), and all VS Code themes.
I'm proud to announce that we have released three new Spatie packages that make it easy to use Shiki in your PHP projects:
We're already using this package to render all our documentation pages, our guidelines, and this very blog you are reading.
Our team has released a new Laravel package: spatie/laravel-artisan-dispatchable. This package allows you to dispatch any job from an artisan command.
In this blog post, I'd like to explain why we created the package and how you can use it.
I'm thrilled to announce that our premium course Event Sourcing in Laravel has just launched.
If you ever wanted to get started with event sourcing, this is the course for you. It contains a beautifully designed ebook, two hours worth of videos, and a demo Laravel app containing an event-sourced shopping cart.
Event sourcing isn't an all or nothing approach. Even if your project doesn't need the full power of event sourcing, you can still benefit from knowing and implementing best practices from the event sourcing world.
We're offering a 20% launch discount for the next two weeks to celebrate this release.
In this stream, you can see my colleague Brent and I launch the course, and answer questions from the audience.
A couple of years ago, Ignition became the default error page in Laravel.
Ignition provided a vastly improved design over Whoops: it brought Laravel specific niceties (such as showing the routing, queries) and the ability to display and even run solutions (e.g. generating an app key).
At Spatie, we think we can improve the design of Ignition even more. Our initial plan was to release this new design in tandem with Laravel 9 as a big bang surprise release. We've changed our mind on this because we'd like to have feedback from the community.
In this blog post, I'd like to share our ideas and plans for Ignition.
Most developers have probably seen some complex conditionals in legacy code. In this video I show you how to refactor those.
Sometimes it is not clear what the responsibility of a certain class is. This can be solved by adding a suffix to the class name.
Our team has released a new package called file-system-watcher. As the name implies, this package can watch changes in the file system and let you act on those changes.
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.
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.
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.
Here's the recording of Laravel Wordwide Meetup #8. My guests for this edition were Kai Sassnowski talking on the importance of DB indexes, and Sebastian De Deyne on how to use Vite in Laravel.
Last week, my colleague Ruben and I launched a major new feature at Flare: there's a new integration with GitHub that makes it possible to:
In this stream, Ruben and I will show you how you can use this integration and how it works under the hood.