PHPackages                             ndlovu28/lbtc - 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. ndlovu28/lbtc

ActiveLibrary

ndlovu28/lbtc
=============

Laravel package to communicate with localbitcoins.com API

0371PHP

Since Oct 16Pushed 5y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Localbitcoins.com API for Laravel
---------------------------------

[](#localbitcoinscom-api-for-laravel)

This package conects localbitcoins.com API. With this package you can:

- Query Balance for your wallet
- Get Bitcoin buyers for a specific regoin
- Initiate a sell trade
- Release bitcoin to a specific trade
- Get chat message from the buyer

### Requirements

[](#requirements)

---

- PHP 7.1+
- Composer

### Installation

[](#installation)

---

To install this package run the commands bellow.

```
composer require ndlovu28/lbtc
```

Register the application in *config/app.php* by appending the line bellow in prividers section

```
Ndlovu28\Lbtc\LbtcServiceProvider::class,
```

Optionally you can add the bellow aliases section to call Lbtc in a short form.

```
'Lbtc' => Ndlovu28\Lbtc\Lbtc::class,
```

Load the database with the command bellow

```
php artisan migrate
```

### Usage

[](#usage)

---

In your controller or class add the line bellow if you added aliases

```
use Lbtc;
```

Or this if you did not add aliases

```
use Ndlovu28\Lbtc\Lbtc;
```

Initialize the class with your localbitcoins *key* and *secret*

```
$lbtc = new Lbtc();
$lbtc->config($key, $secret);
```

#### Check Balance

[](#check-balance)

```
$balance = $lbtc->checkBalance();
```

#### Get an andvert

[](#get-an-andvert)

Get advert with a matching amount to sell bitcoin for, the type of transaction, and location information. This will return the advert id if the found or false if not found

```
$ad_id = $lbtc->getBuyers('20000', 'm-pesa-tanzania-vodacom', 'Tanzania', 'TZ');
```

#### Initialize trade

[](#initialize-trade)

Start a trade with the given ad\_id from get advert query. See [here](https://localbitcoins.com/api-docs/online-buy-fields/) for *trx\_data* array for the required fields for diiiferent payment methods.

```
$contact_id = $lbtc->initTrade($ad_id, $amount, $message, $trx_data);
```

The above will return *contact\_id* which can be used to send messages to the buyer and check status of the trade.

```
//Send mesaage to the buyer
$result = $lbtc->sendMessage($contact_id, $message);

//Get messages array from the buyer
$messages = $lbtc->getMessages($contact_id);

//Check the status of the trade, return true if complete of false if its still pending payment
$status = $lbtc-releseTrade($contact_id)
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/72be84a561ccf809d304ca6d555c2a594445ee74c9713d39d7ce4f39a99e0a93?d=identicon)[ndlovu28](/maintainers/ndlovu28)

### Embed Badge

![Health badge](/badges/ndlovu28-lbtc/health.svg)

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

PHPackages © 2026

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