Laravel Async is a package that provides a straightforward way to run code asynchronous and parallel based on the Spatie Async wrapper for the Laravel application. You can install the Laravel Async package by using Composer: composer require vxm/laravel-async

You can publish the config file (optional) with: php artisan vendor:publish --provider="VXM\Async\AsyncServiceProvider" --tag="config" After installation, now you can try running async code via the Async facade: use Async; for ($i = 1; $i function ($output) { // `$output` of job in this case is `123`.

}, ]); // Another way: Async::run('AsyncJobClass@handleMethod', [ 'success' => 'AsyncJobEventListener@handleSuccess', 'timeout' => 'AsyncJobEventListener@handleTimeout', 'error' => 'AsyncJobEventListener@handleError' ]); Async::batchRun(['AsyncJobClassA@handleMethod', ['success' => 'AsyncJobEventListenerA@handleSuccess']], ['AsyncJobClassB@handleMethod', ['success' => 'AsyncJobEventListenerB@handleSuccess']], ['AsyncJobClassC@handleMethod', ['success' => 'AsyncJobEventListenerC@handleSuccess']]); This package has many great features and options available with code examples.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners