Laravel Concurrency::run execute tasks in parallel
PHP Dasun Kalupahana 319 views
<?php
use Illuminate\Support\Facades\Concurrency;
[$users, $orders] = Concurrency::run([
fn () => \App\Models\User::count(),
fn () => \App\Models\Order::count(),
]);
Runs several closures at the same time and returns their results in order. Use it when a page needs independent slow calls, such as two reports or two APIs, and you want the total time to be the slowest one. Needs Laravel 11.23+.
Learn more on the blog
PostgreSQL vs MySQL Performance: Real Benchmarks Compared
Last updated: 7 November 2026. See the update log at the end."Which...
How to Detect and Fix PHP Memory Leaks
Last updated: 5 November 2026. See the update log at the end.In...
Docker Build Too Slow? 10 Ways to Speed It Up
A slow Docker build usually has one of a few causes: you...