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 has several over 30 functions at the moment that make use of special OPCodes or otherwise inlined to improve performance. Read More
Stefan Zweifel created a nice workflow to automatically merge dependabot PRs when all tests pass Read More
[AdSense-A]
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.
(more…)[AdSense-A]
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.
(more…)With the launch of the Inertia Vue 3 0.3.0 release, however, the boilerplate required to create forms was drastically reduced. Read More
Distributing speaking time can be tricky when meeting face to face, but it is usuallly worse in virtual meetings. Especially those spanning long distances. In my current team, I learned how queues in remote meetings Read more…
I do want to point out that print debugging has one critical feature that most step-based debuggers donât have: you can see program state from multiple time steps all at once. Read More
[AdSense-A]
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.
Imagine that you want to have the user who initiated the queued job available in every queued job. Also, assume that your app has tens or hundreds of jobs you don't want to update manually.
Using this package, this is how you would solve that. Just use AllJobs::add
to add things to all jobs.
// typically in the boot method of a service provider
use Spatie<span class="hljs-title">InteractsWithPayload<span class="hljs-title">Facades<span class="hljs-title">AllJobs;
AllJobs::add('user', fn() => auth()->user());
To retrieve the user in your job, you can call getFromPayload
, which is available through the InteractsWithPayload
trait.
use Illuminate<span class="hljs-title">Contracts<span class="hljs-title">Queue<span class="hljs-title">ShouldQueue;
use Spatie<span class="hljs-title">InteractsWithPayload<span class="hljs-title">Concerns<span class="hljs-title">InteractsWithPayload;
class YourJob implements ShouldQueue
{
use InteractsWithPayload;
<span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">handle</span><span class="hljs-params">()</span>
</span>{
<span class="hljs-comment">// instance of User model or `null`</span>
$user = <span class="hljs-keyword">$this</span>->getFromPayload(<span class="hljs-string">'user'</span>);
}
}
If you want to know how the internals of this package work, watch the video linked above or read the code in the repo on GitHub.
(more…)[AdSense-A]
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
(more…)