PHPackages                             aughyvikrii/laravel-async - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. aughyvikrii/laravel-async

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

aughyvikrii/laravel-async
=========================

Laravel Async

v1.0.1(1y ago)04MITPHPPHP ^8.1

Since May 1Pushed 1y agoCompare

[ Source](https://github.com/aughyvikrii/laravel-async)[ Packagist](https://packagist.org/packages/aughyvikrii/laravel-async)[ RSS](/packages/aughyvikrii-laravel-async/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

Laravel Async
=============

[](#laravel-async)

    laravel-async-demo.mp4    Laravel Async is a simple package for Laravel that enables you to run your code asynchronously without using the workers and Supervisor!

Unlike the Laravel Process, Symfony Process, or other similar packages, You don't need to wait for the sub-processes in the main process to finish!

```
use Aughyvikrii\LaravelAsync\Facades\AsyncHandler;

AsyncHandler::dispatch(function () {
    sleep(10);

    info("Hello from Async process after 10 seconds!");
});

info("dispatched the process!");
```

Demo
----

[](#demo)

How it works?
-------------

[](#how-it-works)

You can call it a hack or a trick! but Laravel Async uses the background process of the OS to run your code.

It provides a simple Laravel Console Command that unserializes your code and runs it in the background of the OS.

Supported OS
------------

[](#supported-os)

Currently, it only supports Linux and Unix-based operating systems.

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require aughyvikrii/laravel-async
```

Configuration
-------------

[](#configuration)

To publish the configuration file, you can run the following command:

```
php artisan vendor:publish --provider="Aughyvikrii\LaravelAsync\LaravelAsyncServiceProvider"
```

This will create a `laravel-async.php` file in your `config` directory.

**php\_path**

The path to the PHP executable. The default value which is the path to the PHP binary should work for CLI usage. However, If you want to use it in web, You should set the path to the PHP binary because the default value will be the path to the web server's PHP binary like php-fpm.

You can also set via the `.env` file.

```
LARAVEL_ASYNC_PHP_PATH=/path/to/php
```

Usage
-----

[](#usage)

The usage is very simple and straightforward. You can provide the Closure or your Laravel Job class to the `AsyncHandler` facade.

### Closure

[](#closure)

```
use Aughyvikrii\LaravelAsync\Facades\AsyncHandler;

AsyncHandler::dispatch(function () {
    info("Hello from Async process!");
});
```

### Job

[](#job)

You can send Jobs or any other classes that have a `handle` method.

```
use Aughyvikrii\LaravelAsync\Facades\AsyncHandler;

AsyncHandler::dispatch(new MyJob());
```

### Timeouts

[](#timeouts)

The default timeout is 60 seconds.

This will set a timeout of 10 seconds to the process and if it didn't finish in 10 seconds it will kill the process.

```
use Aughyvikrii\LaravelAsync\Facades\AsyncHandler;

AsyncHandler::timeout(10)->dispatch(function () {
    info("Hello from Async process!");
});
```

You can also dispatch without a timeout!

!!! Be careful about this because if your code gets stuck in an infinite loop, it will drain your server resources.

```
use Aughyvikrii\LaravelAsync\Facades\AsyncHandler;

AsyncHandler::withoutTimeout()->dispatch(function () {
    info("Hello from Async process!");
});
```

Testing
-------

[](#testing)

You can fake the `AsyncHandler`'s facade in your tests and check if the code is dispatched or not.

```
use Aughyvikrii\LaravelAsync\Facades\AsyncHandler;

AsyncHandler::fake();

// Your code that dispatches the AsyncHandler

AsyncHandler::assertDispatchedCounts(1);
```

You can test to see how many times you dispatched an async process.

Contributing
------------

[](#contributing)

Please feel free to submit an issue or open a PR.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance42

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~277 days

Total

2

Last Release

462d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/89c558bc0cccec69d92c631377334e0d0c474c94cd4f5d0f32e4448b716edca1?d=identicon)[yakarooo](/maintainers/yakarooo)

---

Top Contributors

[![saeedvaziry](https://avatars.githubusercontent.com/u/61919774?v=4)](https://github.com/saeedvaziry "saeedvaziry (22 commits)")[![aughyvikrii](https://avatars.githubusercontent.com/u/28924336?v=4)](https://github.com/aughyvikrii "aughyvikrii (4 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/aughyvikrii-laravel-async/health.svg)

```
[![Health](https://phpackages.com/badges/aughyvikrii-laravel-async/health.svg)](https://phpackages.com/packages/aughyvikrii-laravel-async)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M686](/packages/barryvdh-laravel-ide-helper)[wnx/laravel-stats

Get insights about your Laravel Project

1.8k1.8M7](/packages/wnx-laravel-stats)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

116.6k](/packages/tomshaw-electricgrid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
