PHPackages                             xman12/persistent-request - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. xman12/persistent-request

ActiveLibrary[HTTP &amp; Networking](/categories/http)

xman12/persistent-request
=========================

Library for create persistent request based on laravel framework

1.1.0(2y ago)25LGPL-3.0-or-laterPHPPHP &gt;=7.4

Since Oct 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/xman12/persistent-request)[ Packagist](https://packagist.org/packages/xman12/persistent-request)[ RSS](/packages/xman12-persistent-request/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (6)Used By (0)

Library for create persistent request.
======================================

[](#library-for-create-persistent-request)

Why is it needed?
-----------------

[](#why-is-it-needed)

When to create a fault-tolerant request.

Compatibility
-------------

[](#compatibility)

- php &gt;=7.4
- guzzlehttp/guzzle &gt;=6.3
- laravel/framework &gt;=7.0
- laravel/serializable-closure "^1.\*"

Flow library
------------

[](#flow-library)

[![flow](flow.png)](flow.png)

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

[](#installation)

```
composer require xman12/persistent-request

```

after library has been installed, publish its configuration file using:

```
php artisan vendor:publish --provider="PersistentRequest\ServiceProvider"

```

or add the following providers in config/app.php:

```
'providers' => [PersistentRequest\ServiceProvider::class]

```

Now need start queue work process invalid requests, call command:

```
php artisan queue:work

```

> If request will reach limit attempt when request delete from queue and dispatch event DeleteRequestEvent, which you can processed

Example for create simple persistent request
--------------------------------------------

[](#example-for-create-simple-persistent-request)

```
// here we init service
$requestService = app(\PersistentRequest\Services\RequestServiceInterface::class);
// create instace of Request for send into guzzle client
$requestGuzzle = new \GuzzleHttp\Psr7\Request('get', 'https://google.com');
// create comfortable DTO for transfer to service,
// first argument instance of guzzle request, second name event class, which will be call after success request
// third argument it'sleep seconds, number second after need try again do send request
// fourth argument, number try for send request
$requestDTO = new \PersistentRequest\DTO\RequestDTO($requestGuzzle, \PersistentRequest\Events\SuccessEvent::class, 30, 5);
// execute request, save into db serialize instance of RequestDTO, if request is success then row will be delete
$requestService->execute($requestDTO);

```

### Example for create persistent request with closure

[](#example-for-create-persistent-request-with-closure)

```
// here we init service
$requestService = app(\PersistentRequest\Services\RequestServiceInterface::class);
// create instace of Request for send into guzzle client
$requestGuzzle = new \GuzzleHttp\Psr7\Request('get', 'https://google.com');
// create comfortable DTO for transfer to service,
// first argument instance of guzzle request, second name event class, which will be call after success request
// third argument it'sleep seconds, number second after need try again do send request
// fourth argument, number try for send request
// fifth argrument anonymous function, inside of function we can do businec logic your application, dispatch events etc.
$requestDTO = new \PersistentRequest\DTO\RequestDTO(
    $requestGuzzle,
    \PersistentRequest\Events\SuccessEvent::class,
    30,
    5
    function (\GuzzleHttp\Psr7\Response $response) {
    //here we can do businec logic your application
    // if need then request try again, just throw exception
    if (200 !== $response->getStatusCode()) {
        throw new \Exception('error processed');
    }
});
// execute request
$requestService->execute($requestDTO);

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

4

Last Release

949d ago

Major Versions

0.1.1 → 1.0.02023-10-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/d8967e637cf8597985252852f1cababe1cf71456d9a201335b734834f06d6ac1?d=identicon)[xman12](/maintainers/xman12)

---

Top Contributors

[![xman12](https://avatars.githubusercontent.com/u/3243905?v=4)](https://github.com/xman12 "xman12 (22 commits)")

---

Tags

requestlaravelGuzzlepersistent-request

### Embed Badge

![Health badge](/badges/xman12-persistent-request/health.svg)

```
[![Health](https://phpackages.com/badges/xman12-persistent-request/health.svg)](https://phpackages.com/packages/xman12-persistent-request)
```

###  Alternatives

[hamburgscleanest/guzzle-advanced-throttle

A Guzzle middleware that can throttle requests according to (multiple) defined rules. It is also possible to define a caching strategy, e.g. get response from cache when rate limit is exceeded or always get cached value to spare your rate limits.

13033.4k1](/packages/hamburgscleanest-guzzle-advanced-throttle)[georgeboot/laravel-echo-api-gateway

Use Laravel Echo with API Gateway Websockets

10435.5k](/packages/georgeboot-laravel-echo-api-gateway)[hamburgscleanest/laravel-guzzle-throttle

A Laravel wrapper for https://github.com/hamburgscleanest/guzzle-advanced-throttle.

7914.3k](/packages/hamburgscleanest-laravel-guzzle-throttle)[behamin/service-proxy

for proxy or sending requests to other services with useful utilities

102.2k](/packages/behamin-service-proxy)

PHPackages © 2026

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