PHPackages                             lukapeharda/pushlapgrowth - 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. [API Development](/categories/api)
4. /
5. lukapeharda/pushlapgrowth

ActiveLibrary[API Development](/categories/api)

lukapeharda/pushlapgrowth
=========================

A PHP client for the PushLapGrowth API

1.1.0(1mo ago)052MITPHPPHP ^7.3 || ^8.0

Since Dec 29Pushed 1mo agoCompare

[ Source](https://github.com/lukapeharda/push-lap-growth)[ Packagist](https://packagist.org/packages/lukapeharda/pushlapgrowth)[ RSS](/packages/lukapeharda-pushlapgrowth/feed)WikiDiscussions main Synced 1mo ago

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

PushLapGrowth PHP Client
========================

[](#pushlapgrowth-php-client)

A PHP client for the [PushLapGrowth API](https://developers.pushlapgrowth.com/api-reference/).

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

[](#installation)

Install via Composer:

```
composer require lukapeharda/pushlapgrowth
```

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

[](#requirements)

- PHP 7.4 or higher
- Guzzle HTTP Client

Usage (Standard PHP)
--------------------

[](#usage-standard-php)

You can use the client in any PHP application by instantiating the `Client` class with your API Token.

```
use PushLapGrowth\Client;
use PushLapGrowth\DTO\CreateSaleData;
use PushLapGrowth\DTO\UpdateSaleData;
use PushLapGrowth\DTO\CreateReferralData;
use PushLapGrowth\Exceptions\ValidationException;

// Initialize Client
$client = new Client('YOUR_API_TOKEN');

try {
    // 0. Create a Referral
    $referralData = new CreateReferralData(
        'John Doe',
        'john@example.com',
        'ext_123', // referredUserExternalId
        'aff_abc'  // affiliateId (optional)
        // ... options: affiliateEmail, promoCode, plan, status
    );
    $client->createReferral($referralData);

    // 1. Create a Sale
    $data = new CreateSaleData(
        100.0,          // totalEarned
        'ref_123',      // referralId (optional)
        'user@example.com' // email (optional)
    );
    $response = $client->createSale($data);
    print_r($response);

    // 2. Update a Sale (using Internal ID)
    $updateData = new UpdateSaleData(
        $response['id'], // saleId
        'New Name',      // name
        null,            // email
        150.0            // totalEarned
    );
    $client->updateSale($updateData);

    // 3. Update a Sale (using External ID)
    // Useful if you only store your own system's IDs
    $externalUpdateData = new UpdateSaleData(
        null, // ID looked up automatically
        null,
        null,
        250.0
    );
    $client->updateSaleUsingExternalId('my_external_id_123', $externalUpdateData);

    // 4. Delete a Sale
    $client->deleteSale($response['id']);

    // 5. Delete a Sale (using External ID)
    $client->deleteSaleUsingExternalId('my_external_id_123');

} catch (ValidationException $e) {
    // Handle Validation Errors (422)
    print_r($e->getErrors());
} catch (\Exception $e) {
    // Handle other errors
    echo $e->getMessage();
}
```

Usage (Laravel)
---------------

[](#usage-laravel)

This package includes a Service Provider and Facade-like behavior for Laravel 5.6+ and above.

### 1. Configuration

[](#1-configuration)

Publish the configuration file (optional):

```
php artisan vendor:publish --provider="PushLapGrowth\PushLapGrowthServiceProvider" --tag="config"
```

Add your API Token to `.env`:

```
PUSHLAPGROWTH_API_TOKEN=your_token_here
```

### 2. Dependency Injection

[](#2-dependency-injection)

You can type-hint the `Client` class in your Controllers, Jobs, or Services.

```
use PushLapGrowth\Client;
use PushLapGrowth\DTO\CreateSaleData;

class SaleController extends Controller
{
    public function store(Client $client)
    {
        $data = new CreateSaleData(50.0, 'ref_abc');
        $client->createSale($data);

        return response()->json(['status' => 'success']);
    }
}
```

Error Handling
--------------

[](#error-handling)

The client throws specific exceptions for different error scenarios:

- `PushLapGrowth\Exceptions\ValidationException`: Thrown on 422 Unprocessable Entity. Use `getErrors()` to see details.
- `PushLapGrowth\Exceptions\NotFoundException`: Thrown on 404 Not Found.
- `PushLapGrowth\Exceptions\ApiException`: Thrown on other API errors (500, 400, etc.).

All exceptions extend `PushLapGrowth\Exceptions\PushLapGrowthException`.

Testing
-------

[](#testing)

Run the test suite:

```
vendor/bin/phpunit
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance91

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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 ~21 days

Total

5

Last Release

45d ago

PHP version history (2 changes)1.0.0PHP ^7.4 || ^8.0

1.0.3PHP ^7.3 || ^8.0

### Community

Maintainers

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

---

Top Contributors

[![lukapeharda](https://avatars.githubusercontent.com/u/2076692?v=4)](https://github.com/lukapeharda "lukapeharda (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lukapeharda-pushlapgrowth/health.svg)

```
[![Health](https://phpackages.com/badges/lukapeharda-pushlapgrowth/health.svg)](https://phpackages.com/packages/lukapeharda-pushlapgrowth)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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