PHPackages                             dskripchenko/laravel-delayed-process - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. dskripchenko/laravel-delayed-process

ActiveLibrary[Queues &amp; Workers](/categories/queues)

dskripchenko/laravel-delayed-process
====================================

Delayed Process For Laravel.

2.0.0(1mo ago)02.5k↓100%MITPHPPHP ^8.5

Since Feb 27Pushed 1mo ago1 watchersCompare

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

READMEChangelogDependencies (5)Versions (10)Used By (0)

Laravel Delayed Process
=======================

[](#laravel-delayed-process)

[![Packagist Version](https://camo.githubusercontent.com/4323f03db6fdcca8c6dd0c41f6d25bd5576acb602769cc25f82c0a4410e9b8cd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64736b7269706368656e6b6f2f6c61726176656c2d64656c617965642d70726f63657373)](https://packagist.org/packages/dskripchenko/laravel-delayed-process)[![License](https://camo.githubusercontent.com/b1c6e4481cfb005b76cbd6f6423236091d77def49bde8adb3c50b3d0e2398bb3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f64736b7269706368656e6b6f2f6c61726176656c2d64656c617965642d70726f63657373)](LICENSE.md)[![PHP Version](https://camo.githubusercontent.com/0ce5ace79239c1829a04a232d554df5fe43f60e976c178b3ec4482166666d8b4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f64736b7269706368656e6b6f2f6c61726176656c2d64656c617965642d70726f636573732f706870)](composer.json)[![Laravel Version](https://camo.githubusercontent.com/b8f80a233ba4da3398ad81f6ff6d5117a68e1fb728aad450e8246e5b255cc705/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f64736b7269706368656e6b6f2f6c61726176656c2d64656c617965642d70726f636573732f6c61726176656c2f6672616d65776f726b)](composer.json)

**Language:** [English](README.md) | [Русский](docs/README.ru.md) | [Deutsch](docs/README.de.md) | [中文](docs/README.zh.md)

Asynchronous execution of long-running operations in Laravel with UUID-based tracking, automatic retry, security allowlist, and transparent frontend interceptors for Axios, Fetch, and XHR.

---

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Architecture](#architecture)
- [Process Lifecycle](#process-lifecycle)
- [Project Structure](#project-structure)
- [Backend API](#backend-api)
- [Frontend Interceptors](#frontend-interceptors)
- [Configuration Reference](#configuration-reference)
- [Database Schema](#database-schema)
- [Security](#security)
- [Cookbook](#cookbook)
- [License](#license)

---

Features
--------

[](#features)

- **Async Processing** — offload heavy operations to a queue, return UUID immediately
- **UUID Tracking** — every process gets a UUIDv7 for status polling
- **Automatic Retry** — configurable max attempts with error capture on final failure
- **Security Allowlist** — only explicitly allowed entity classes can be executed
- **Frontend Interceptors** — transparent Axios, Fetch, and XHR interceptors that auto-poll until completion
- **Batch Polling** — `BatchPoller` class for polling multiple UUIDs in a single request
- **Loop Prevention** — `X-Delayed-Process-Poll` header prevents interceptors from re-intercepting poll requests
- **Lifecycle Events** — `ProcessCreated`, `ProcessStarted`, `ProcessCompleted`, `ProcessFailed` events for observability
- **Progress Tracking** — 0-100% progress updates via `ProcessProgressInterface`
- **Webhook Callbacks** — HTTP POST notifications to `callback_url` on terminal status
- **TTL / Expiration** — automatic process expiration via `expires_at` + `delayed:expire` command
- **Cancellation** — cancel processes in `new`/`wait` status via builder
- **Per-entity Queue Config** — configure queue, connection, and timeout per entity class
- **Artisan Commands** — `delayed:process`, `delayed:clear`, `delayed:unstuck`, `delayed:expire`, `delayed:migrate-v1` (legacy migration)
- **Structured Logging** — captures all `MessageLogged` events during execution, configurable buffer limit
- **Atomic Claiming** — race-condition-safe process claiming via atomic UPDATE
- **PostgreSQL Optimized** — partial indexes, JSONB columns, TIMESTAMPTZ; MySQL/MariaDB also supported

---

Requirements
------------

[](#requirements)

DependencyVersionPHP^8.5Laravel^12.0DatabasePostgreSQL (recommended) or MySQL/MariaDB---

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

[](#installation)

```
composer require dskripchenko/laravel-delayed-process
```

Publish the configuration file:

```
php artisan vendor:publish --tag=delayed-process-config
```

Run the migration:

```
php artisan migrate
```

Register allowed entities in `config/delayed-process.php`:

```
'allowed_entities' => [
    \App\Services\ReportService::class,
    \App\Services\ExportService::class,
],
```

---

Quick Start
-----------

[](#quick-start)

### 1. Create a Handler

[](#1-create-a-handler)

```
