PHPackages                             brain-nucleus/client - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. brain-nucleus/client

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

brain-nucleus/client
====================

Official Brain Nucleus event client for Laravel and standalone PHP applications

v1.2.0(6mo ago)05.0k↓31.5%MITPHPPHP ^8.1

Since Dec 22Pushed 2mo agoCompare

[ Source](https://github.com/iamjasonhill/brain-client)[ Packagist](https://packagist.org/packages/brain-nucleus/client)[ Docs](https://github.com/iamjasonhill/brain-client)[ RSS](/packages/brain-nucleus-client/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (5)Used By (0)

Brain Nucleus Client for Laravel
================================

[](#brain-nucleus-client-for-laravel)

Official client for sending events to Brain Nucleus from Laravel applications.

This repo is the canonical standalone source for the reusable client/package layer.

It is distinct from:

- `MM BRAIN`, which owns strategy, priority, interpretation, and history
- `Brain2026`, which owns the SEO, research, builder, and orchestration lane
- `TheBrain`, which is the control-plane application and is moving toward the function-led identity `MM-Control-Plane`

The package name `brain-nucleus/client` remains in place for compatibility. Any future package renaming should be staged carefully after downstream install/versioning impact is mapped.

🚀 Quick Start
-------------

[](#-quick-start)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require brain-nucleus/client:dev-main
```

> **Note:** First-time install? Add the repository to `composer.json`:
>
> ```
> {
>     "repositories": [
>         {
>             "type": "vcs",
>             "url": "https://github.com/iamjasonhill/brain-client.git"
>         }
>     ]
> }
> ```

### 2. Add Environment Variables

[](#2-add-environment-variables)

```
BRAIN_BASE_URL=https://again.com.au
BRAIN_API_KEY=your-api-key-here
```

> **Need an API key?** Log into [Brain Admin](https://again.com.au/admin) → API Keys → New API Key

### 3. Done! 🎉

[](#3-done-)

That's it. The package auto-registers via Laravel's package discovery.

---

✅ What's Automatic (No Code Required)
-------------------------------------

[](#-whats-automatic-no-code-required)

FeatureDescription**Heartbeat**`health.ping` sent every 5 minutes automatically**Singleton**`BrainEventClient` ready for dependency injection**Command**`php artisan brain:heartbeat` for manual testing---

⚠️ What You Need to Implement
-----------------------------

[](#️-what-you-need-to-implement)

The package handles heartbeats automatically, but you must implement:

1. **Error Exception Handling** → Send `error.exception` events
2. **Queue Failed Job Handling** → Send `queue.failed` events

📋 **See [IMPLEMENTATION-CHECKLIST.md](IMPLEMENTATION-CHECKLIST.md) for complete code examples.**

---

💻 Sending Events
----------------

[](#-sending-events)

Inject `BrainEventClient` anywhere in your application:

```
use Brain\Client\BrainEventClient;

class QuoteController extends Controller
{
    public function store(Request $request, BrainEventClient $brain)
    {
        $quote = Quote::create($request->validated());

        $brain->send('quote.created', [
            'quote_id' => $quote->id,
            'email' => $quote->email,
            'amount' => $quote->total,
        ]);

        return response()->json($quote);
    }
}
```

### Async Events (Fire and Forget)

[](#async-events-fire-and-forget)

For non-blocking events:

```
$brain->sendAsync('page.viewed', [
    'page' => request()->path(),
    'user_id' => auth()->id(),
]);
```

---

⚙️ Configuration (Optional)
---------------------------

[](#️-configuration-optional)

Publish the config file to customise behaviour:

```
php artisan vendor:publish --tag=brain-config
```

**config/brain.php:**

```
return [
    'base_url' => env('BRAIN_BASE_URL'),
    'api_key' => env('BRAIN_API_KEY'),

    'heartbeat' => [
        'enabled' => true,  // Set false to disable auto-heartbeat
        'interval' => 5,    // Minutes between heartbeats
    ],

    // Register site-specific custom events
    'events' => [
        'carrier.rate_received' => 'Rate received from transport carrier',
        'quote.manual_override' => 'Quote manually adjusted by staff',
    ],
];
```

---

🔄 Updating the Client
---------------------

[](#-updating-the-client)

```
composer update brain-nucleus/client
```

---

📚 Documentation
---------------

[](#-documentation)

DocumentPurpose[IMPLEMENTATION-CHECKLIST.md](IMPLEMENTATION-CHECKLIST.md)Required implementations (error handling, queue failures)[INTEGRATION-GUIDE.md](INTEGRATION-GUIDE.md)Advanced code patterns and examples[OPS-EVENT-SPEC.md](OPS-EVENT-SPEC.md)Event specifications and fingerprinting[EVENTS.md](EVENTS.md)Business event definitions[docs/PACKAGE-IDENTITY-PLAN.md](docs/PACKAGE-IDENTITY-PLAN.md)Staged package naming recommendation and compatibility constraints---

🔗 Quick Links
-------------

[](#-quick-links)

- **Brain Admin:**
- **Health Check:**
- **Repository:**

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance78

Regular maintenance activity

Popularity23

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

Total

4

Last Release

192d ago

### Community

Maintainers

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

---

Top Contributors

[![iamjasonhill](https://avatars.githubusercontent.com/u/186772261?v=4)](https://github.com/iamjasonhill "iamjasonhill (8 commits)")

---

Tags

laravelmonitoringeventsanalyticsbrainincidents

### Embed Badge

![Health badge](/badges/brain-nucleus-client/health.svg)

```
[![Health](https://phpackages.com/badges/brain-nucleus-client/health.svg)](https://phpackages.com/packages/brain-nucleus-client)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M150](/packages/laravel-mcp)[api-platform/laravel

API Platform support for Laravel

58171.4k14](/packages/api-platform-laravel)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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