PHPackages                             smart-dato/brt - 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. smart-dato/brt

ActiveLibrary[API Development](/categories/api)

smart-dato/brt
==============

BRT Laravel sdk

0.0.4(2mo ago)0876↓32.2%[1 PRs](https://github.com/smart-dato/brt/pulls)MITPHPPHP ^8.2CI passing

Since Mar 14Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/smart-dato/brt)[ Packagist](https://packagist.org/packages/smart-dato/brt)[ Docs](https://github.com/smart-dato/brt)[ GitHub Sponsors](https://github.com/SmartDato)[ RSS](/packages/smart-dato-brt/feed)WikiDiscussions main Synced 1mo ago

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

BRT Laravel SDK
===============

[](#brt-laravel-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a4c65a7a6df788508518e543de69034c5b9a788b51289c31dc0abae50190b666/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736d6172742d6461746f2f6272742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/smart-dato/brt)[![GitHub Tests Action Status](https://camo.githubusercontent.com/875fa799539d269b254ef64b583b94a7126d99246d10f4cb3cc8594914d01f54/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736d6172742d6461746f2f6272742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/smart-dato/brt/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/c69e2c8fc11ceadbcd3881a49720b5b2c803fdac2470b0826eeab3a80d82f48e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736d6172742d6461746f2f6272742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/smart-dato/brt/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/d4201f03e01184bc89a165c227de64873e005ae9bd9413349a14427db2aa7806/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736d6172742d6461746f2f6272742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/smart-dato/brt)

A Laravel package for integrating with the [BRT (Bartolini)](https://www.brt.it/) courier API, built on [Saloon](https://docs.saloon.dev/).

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

[](#installation)

```
composer require smart-dato/brt
```

Publish the config file:

```
php artisan vendor:publish --tag="brt-config"
```

This is the contents of the published config file:

```
return [
    'base_url' => env('BRT_BASE_URL', 'https://api.brt.it/orm'),
    'api_key' => env('BRT_API_KEY'),
];
```

Add your API key to `.env`:

```
BRT_API_KEY=your-api-key

```

Usage
-----

[](#usage)

### Create a pickup request

[](#create-a-pickup-request)

```
use SmartDato\Brt\BrtConnector;
use SmartDato\Brt\Enums\PayerType;
use SmartDato\Brt\Enums\Stakeholder\Type;
use SmartDato\Brt\Requests\Pickup\Create\CreatePickupRequest;
use SmartDato\Brt\ValueObjects\BrtSpecifics;
use SmartDato\Brt\ValueObjects\CollectionRequest;
use SmartDato\Brt\ValueObjects\CustomerInfos;
use SmartDato\Brt\ValueObjects\OpeningHour;
use SmartDato\Brt\ValueObjects\RequestInfos;
use SmartDato\Brt\ValueObjects\Stakeholder\Contact;
use SmartDato\Brt\ValueObjects\Stakeholder\ContactDetails;
use SmartDato\Brt\ValueObjects\Stakeholder\Customer;
use SmartDato\Brt\ValueObjects\Stakeholder\Stakeholder;

$connector = new BrtConnector();

$response = $connector->send(
    new CreatePickupRequest([
        new CollectionRequest(
            requestInfos: new RequestInfos(
                collectionDate: now()->nextWeekday(),
                parcelCount: 1,
            ),
            customerInfos: new CustomerInfos(
                custAccNumber: '0000000',
            ),
            stakeholders: [
                new Stakeholder(
                    type: Type::Requester,
                    customerInfos: new Customer(
                        custAccNumber: '0000000000',
                    ),
                ),
                new Stakeholder(
                    type: Type::Sender,
                    customerInfos: new Customer(
                        custAccNumber: '0000000000',
                    ),
                    contact: new Contact(
                        contactDetails: new ContactDetails(
                            phone: '0000000000',
                            contactPerson: 'John Doe',
                        ),
                    ),
                ),
            ],
            brtSpec: new BrtSpecifics(
                collectionTime: '11:00',
                goodDescription: 'Package description',
                payerType: PayerType::Ordering,
                weightKG: 2.3,
                openingHours: [
                    new OpeningHour(from: '10:00', to: '13:00'),
                    new OpeningHour(from: '15:00', to: '17:00'),
                ],
            ),
        ),
    ])
);

$data = $response->json();
```

### Search pickup requests

[](#search-pickup-requests)

```
use SmartDato\Brt\BrtConnector;
use SmartDato\Brt\Enums\Sort;
use SmartDato\Brt\Requests\Pickup\Search\SearchPickupRequest;

$connector = new BrtConnector();

$response = $connector->send(
    new SearchPickupRequest(
        limit: 10,
        offset: 0,
        sort: Sort::DESC,
    )
);
```

### Get pickup details

[](#get-pickup-details)

```
use SmartDato\Brt\Requests\Pickup\Search\DetailPickupRequest;

$response = $connector->send(new DetailPickupRequest(id: '123456'));
```

### Count pickup requests

[](#count-pickup-requests)

```
use SmartDato\Brt\Requests\Pickup\Search\CountPickupRequest;

$response = $connector->send(new CountPickupRequest());
```

### Cancel a pickup

[](#cancel-a-pickup)

```
use SmartDato\Brt\Requests\Pickup\Cancellation\CancelPickupRequest;

$response = $connector->send(new CancelPickupRequest(id: '123456'));
```

### Update a pickup

[](#update-a-pickup)

```
use SmartDato\Brt\Requests\Pickup\Edit\UpdatePickupRequest;

$response = $connector->send(new UpdatePickupRequest(id: '123456'));
```

### Using a custom API key

[](#using-a-custom-api-key)

You can pass a token directly to the connector instead of using the config:

```
$connector = new BrtConnector(token: 'your-api-key');
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [SmartDato](https://github.com/smart-dato)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance87

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

4

Last Release

68d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c3006db55caec62526937fa2d941da32fc5e69e2ca86a52e87c8046da5958d82?d=identicon)[smart-dato](/maintainers/smart-dato)

---

Top Contributors

[![tschigo](https://avatars.githubusercontent.com/u/344100?v=4)](https://github.com/tschigo "tschigo (8 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![michael-tscholl](https://avatars.githubusercontent.com/u/178569346?v=4)](https://github.com/michael-tscholl "michael-tscholl (6 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

laravelSmartDatobrt

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/smart-dato-brt/health.svg)

```
[![Health](https://phpackages.com/badges/smart-dato-brt/health.svg)](https://phpackages.com/packages/smart-dato-brt)
```

###  Alternatives

[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1221.1k](/packages/codebar-ag-laravel-docuware)[codebar-ag/laravel-zammad

Zammad integration with Laravel

106.1k](/packages/codebar-ag-laravel-zammad)[tapp/filament-webhook-client

Add a Filament resource and a policy for Spatie Webhook client

1120.2k](/packages/tapp-filament-webhook-client)

PHPackages © 2026

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