PHPackages                             dmt-software/laposta-api - 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. dmt-software/laposta-api

ActiveLibrary[API Development](/categories/api)

dmt-software/laposta-api
========================

Client to consume the Laposta API

0.4.0(6mo ago)011.5k—10%[1 issues](https://github.com/dmt-software/laposta-api/issues)MITPHPPHP &gt;=8.3

Since Apr 12Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/dmt-software/laposta-api)[ Packagist](https://packagist.org/packages/dmt-software/laposta-api)[ RSS](/packages/dmt-software-laposta-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (13)Used By (0)

Laposta API
===========

[](#laposta-api)

An Object-Oriented client to consume the Laposta API.

Install
-------

[](#install)

```
composer require dmt-software/laposta-api
```

### Configure

[](#configure)

After installing this package you need to configure it. The quickest way to do this is simply add a config file and use it to load the config into a `Config` instance.

```
// file: config.php

return [
    'apiKey' => 'JdMtbsMq2jqJdQZD9AHC',
    'customFieldsClasses' => [],
    'httpClient' => \GuzzleHttp\Client::class,
    'requestFactory' => \GuzzleHttp\Psr7\HttpFactory::class,
];
```

### Generate entity

[](#generate-entity)

The next step is to generate an entity for the custom fields for the mailing list(s).

```
vendor/bin/laposta generate:list-fields config.php -l BaImMu3JZA
```

More in depth information about the custom fields can be found in the subscribers [documentation](/docs/subscribers.md).

Usage
-----

[](#usage)

### Initiate a Client

[](#initiate-a-client)

The easiest way to create a client instance is using the factories in this package. These factories can also be used (as guideline) in a dependency injection container.

```
use DMT\Laposta\Api\Clients\Subscribers;
use DMT\Laposta\Api\Config;
use DMT\Laposta\Api\Factories\CommandBusFactory;

$commandBus = CommandBusFactory::create(Config::load('config.php'));

$client = new Subscribers($commandBus);
```

### Subscribe a user to a mailing list

[](#subscribe-a-user-to-a-mailing-list)

```
use DMT\CommandBus\Validator\ValidationException;
use DMT\Laposta\Api\Entity\BaseCustomFields;
use DMT\Laposta\Api\Entity\Subscriber;
use DMT\Laposta\Api\Clients\Subscribers;
use Psr\Http\Client\ClientExceptionInterface;

try {
    /** @var BaseCustomFields $customFields The generated entity for your list */

    $subscriber = new Subscriber();
    $subscriber->listId = 'BaImMu3JZA';
    $subscriber->email = 'user@example.com';
    $subscriber->customFields = $customFields;
    $subscriber->customFields->name = 'John Do';

    /** @var Subscribers $client */
    $client->create($subscriber, Subscribers::OPTION_SUPPRESS_EMAIL_NOTIFICATION);
} catch (ValidationException $exception) {
     // input was wrong
} catch (ClientExceptionInterface $exception) {
    // error response
}
```

More on how to use this package can be found in the client [documentation](/docs/clients.md).

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance67

Regular maintenance activity

Popularity25

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Recently: every ~153 days

Total

12

Last Release

195d ago

PHP version history (2 changes)0.1.0PHP &gt;=7.4

0.4.0PHP &gt;=8.3

### Community

Maintainers

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

---

Top Contributors

[![proggeler](https://avatars.githubusercontent.com/u/18281353?v=4)](https://github.com/proggeler "proggeler (69 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dmt-software-laposta-api/health.svg)

```
[![Health](https://phpackages.com/badges/dmt-software-laposta-api/health.svg)](https://phpackages.com/packages/dmt-software-laposta-api)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k9.6M468](/packages/saloonphp-saloon)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)[wordpress/php-ai-client

A provider agnostic PHP AI client SDK to communicate with any generative AI models of various capabilities using a uniform API.

26236.6k14](/packages/wordpress-php-ai-client)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)[prokerala/astrology-sdk

Prokerala.com Astrology API Client Library for PHP.

2610.0k](/packages/prokerala-astrology-sdk)

PHPackages © 2026

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