PHP
★ Exploring Event Sourcing (part 2)
[AdSense-A]
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.
You'll find part 1 of our conversation on YouTube.
(more…)PHP
★ A lightweight solution for running PHP code concurrently
[AdSense-A]
Our team released a new package called spatie/fork. Using this package you can easily execute multiple pieces of code concurrently.
In this example, where we are going to call an imaginary slow API, all three closures will run at the same time.
use SpatieForkFork;
$results = Fork::new()
->run(
fn () => (new Api)->fetchData(userId: 1),
fn () => (new Api)->fetchData(userId: 2),
fn () => (new Api)->fetchData(userId: 3),
);
$results[0]; // fetched data of user 1
$results[1]; // fetched data of user 2
$results[2]; // fetched data of user 3
If you want to know more about why we created the package, check out this blogpost by my colleague Brent.
In the video below, which was streamed live, you can see me explain the internals.
To know more about how to use the package, head over to the readme of spatie/fork on GitHub.
(more…)PHP
Authoring Great Pull Requests
Some best practices and tips for composing high quality pull requests when contributing to open source projects. Read More
PHP
Back the func off, this is my abstraction!
Let’s dive into some of the design considerations you might make when designing abstractions that reach over a network. Read More
PHP
Simple Models, Scaffolding, Enabling Constraints
All models are wrong but simple models are more wrong than complex ones. Simple models are more appealing, easier to teach and spread and apply. Because of that, they can bring value faster, and they Read more…
PHP
Modelling time
This is a very nice talk given by Eric Evans at DDD Europe 2018. He argues that sometimes try to solve a problem, without reaching to existing solutions, might provide good insights.
PHP
Function Inlining in PHP's Zend Engine
PHP has several over 30 functions at the moment that make use of special OPCodes or otherwise inlined to improve performance. Read More
PHP
Auto Merge Dependabot Pull Requests
Stefan Zweifel created a nice workflow to automatically merge dependabot PRs when all tests pass Read More