PHPackages                             graymatterlabs/pingtree - 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. graymatterlabs/pingtree

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

graymatterlabs/pingtree
=======================

A Ping Tree is a process in which a single lead is offered to multiple buyers in real-time and sold to the highest bidder

v0.2.0.2(3y ago)13512[2 PRs](https://github.com/graymatterlabs/pingtree/pulls)MITPHPPHP ^8.0

Since Aug 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/graymatterlabs/pingtree)[ Packagist](https://packagist.org/packages/graymatterlabs/pingtree)[ Docs](https://github.com/graymatterlabs/pingtree)[ GitHub Sponsors](https://github.com/graymatterlabs)[ RSS](/packages/graymatterlabs-pingtree/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (8)Used By (0)

Ping Tree Lead Distribution
===========================

[](#ping-tree-lead-distribution)

[![Latest Version on Packagist](https://camo.githubusercontent.com/268eb07d729c360cb40e3006ed3fef4d8cdc72f393dea33f3e0632cc82da592a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f677261796d61747465726c6162732f70696e67747265652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/graymatterlabs/pingtree)[![Tests](https://github.com/graymatterlabs/pingtree/actions/workflows/run-tests.yml/badge.svg?branch=master)](https://github.com/graymatterlabs/pingtree/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/03286815c84b0fea50843de84463d1e16da297830256de049540479f21dafffd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f677261796d61747465726c6162732f70696e67747265652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/graymatterlabs/pingtree)

A Ping Tree is a process in which a single lead is offered to multiple buyers in real-time and sold to the highest bidder.

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

[](#installation)

You can install the package via composer:

```
composer require graymatterlabs/pingtree:^0.3.0
```

Usage
-----

[](#usage)

```
$tree = new Tree($strategy, $offers);

$response = $tree->ping($lead);
```

### Responses

[](#responses)

The ping tree will return the first successful response provided by an offer. Responses must implement the `GrayMatterLabs\PingTree\Contracts\Response` interface but should be customized beyond that.

```
$tree = new Tree($strategy, $offers);

$response = $tree->ping($lead);

if ($response instanceof RedirectResponse) {
  return redirect($response->url());
}
```

### Offers

[](#offers)

Offer instances are responsible for communicating with and managing state of the offer such as health and eligibility rules.

```
