PHPackages                             binarycabin/brainblocks - 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. [Payment Processing](/categories/payments)
4. /
5. binarycabin/brainblocks

ActiveLibrary[Payment Processing](/categories/payments)

binarycabin/brainblocks
=======================

An integration helper for taking Nano payments via BrainBlocks

1.4.3(7y ago)01372MITHTML

Since May 26Pushed 7y agoCompare

[ Source](https://github.com/binarycabin/brainblocks)[ Packagist](https://packagist.org/packages/binarycabin/brainblocks)[ RSS](/packages/binarycabin-brainblocks/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (7)Dependencies (1)Versions (9)Used By (0)

BrainBlocks for Laravel
=======================

[](#brainblocks-for-laravel)

An integration helper for taking Nano payments via BrainBlocks.io

This package adds a few helpers when adding a BrainBlocks button with Laravel

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

[](#installation)

```
composer require binarycabin/brainblocks

```

In .env, add your Nano wallet address the button will send to:

```
BRAINBLOCKS_RECEIVE_ADDRESS=nano_1999...

```

Adding Buttons
--------------

[](#adding-buttons)

Simply include the button view where you would like the button to appear. Be sure to include the amount (in rai) that the button will take as well as the url the button will POST to with a valid brainblocks token:

```
@include('brainblocks::button',['amount'=>1000,'action'=>url('/pay')])

```

You can add multiple buttons on this page using this include. Then at the bottom of the page, be sure to add your javascript

```
@include('brainblocks::scripts')

```

Validating BrainBlocks Responses
--------------------------------

[](#validating-brainblocks-responses)

In your POST route, call the

```
Route::post('/pay', function(Request $request){
    $brainBlocksResponse = \BrainBlocks::getTokenResponse($request->brainblocks_token);
    $responseIsValid = \BrainBlocks::validateResponse($brainBlocksResponse,[
        'amount_rai' => 200,
    ]);
    dump($brainBlocksResponse);
    if($responseIsValid){
    	//.. do successful stuff
    }
});

```

`BrainBlocks::getTokenResponse` will return the full response from the BrainBlocks, this can be validated manually or you can use the `validateResponse` helper.

By default, the `validateResponse` helper will make sure:

- the `fulfilled` property is `true`
- the "destination" address matches the address your config The second property takes an array of additional validations you would like to check, for example checking the amount.

Custom Currencies
-----------------

[](#custom-currencies)

In addition to the default "rai", you can change the currency used to any of the supported currencies listed on [brainblocks.io](https://brainblocks.io)

```
@include('brainblocks::button',['amount'=>5,'currency'=>'usd','action'=>url('/pay')])

```

Be sure to update your validator to look for the correct currency and amount

```
$responseIsValid = \BrainBlocks::validateResponse($brainBlocksResponse,[
	'amount' => 5,
	'currency' => 'usd',
]);

```

Custom Destination
------------------

[](#custom-destination)

If you need a specific button to go to a destination address other than the one set in your configuration, you can add it as an option as well

```
@include('brainblocks::button',['amount'=>1000,'destination'=>'nano_11223344...','action'=>url('/pay')])

```

Be sure to update your validator to look for the changed destination instead of the default

```
$responseIsValid = \BrainBlocks::validateResponse($brainBlocksResponse,[
	'amount_rai' => 1000,
	'destination' => 'xrb_1kojnrrw8rtybqsqk5uh7bcioo8thkiqjkibmn43togd416gzfye6j44b9sc',
]);

```

Donate
------

[](#donate)

[![Donate with NaNote](https://camo.githubusercontent.com/d7afa55fc23fee88285750ac407d7794f2c1bdd22067da75b862bced5688603f/68747470733a2f2f692e696d6775722e636f6d2f614c6f707457412e706e67)](https://nanote.net/pay/binarycabin)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 93.8% 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 ~27 days

Total

8

Last Release

2764d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33656106?v=4)[Binary Cabin](/maintainers/binarycabin)[@binarycabin](https://github.com/binarycabin)

---

Top Contributors

[![kilrizzy](https://avatars.githubusercontent.com/u/132478?v=4)](https://github.com/kilrizzy "kilrizzy (15 commits)")[![nicolas-t](https://avatars.githubusercontent.com/u/1765930?v=4)](https://github.com/nicolas-t "nicolas-t (1 commits)")

### Embed Badge

![Health badge](/badges/binarycabin-brainblocks/health.svg)

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.5k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[chargebee/chargebee-php

ChargeBee API client implementation for PHP

758.5M9](/packages/chargebee-chargebee-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k13](/packages/tempest-framework)[imdhemy/google-play-billing

Google Play Billing

491.5M5](/packages/imdhemy-google-play-billing)

PHPackages © 2026

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