PHPackages                             rocont/laravel-notification-channel-compass - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. rocont/laravel-notification-channel-compass

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

rocont/laravel-notification-channel-compass
===========================================

Laravel Notification Channel for Compass Userbot

v0.1.0(2mo ago)09MITPHPPHP ^8.1CI passing

Since Oct 10Pushed 2mo agoCompare

[ Source](https://github.com/Rocont/laravel-notification-channel-compass)[ Packagist](https://packagist.org/packages/rocont/laravel-notification-channel-compass)[ Docs](https://github.com/Rocont/laravel-notification-channel-compass)[ RSS](/packages/rocont-laravel-notification-channel-compass/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

Laravel Notification Channel for Compass
========================================

[](#laravel-notification-channel-for-compass)

[![Latest Version](https://camo.githubusercontent.com/78c48697c2a5badc6fda11efecb073cccc636d6972c66a61833ebd5c43dcee08/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f636f6e742f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c2d636f6d706173732e737667)](https://packagist.org/packages/rocont/laravel-notification-channel-compass)[![Tests](https://github.com/Rocont/laravel-notification-channel-compass/actions/workflows/tests.yml/badge.svg)](https://github.com/Rocont/laravel-notification-channel-compass/actions)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

Laravel notification channel for [Compass Userbot API](https://github.com/getCompass/userbot). Send messages to users, groups, and threads via standard Laravel notifications.

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

[](#installation)

```
composer require rocont/laravel-notification-channel-compass
```

```
php artisan vendor:publish --provider="Rocont\CompassChannel\CompassServiceProvider" --tag=config
```

Add to `.env`:

```
COMPASS_BOT_TOKEN=your-bot-token
COMPASS_BASE_URL=https://userbot.getcompass.com/
```

Configuration
-------------

[](#configuration)

Published config `config/compass.php`:

```
return [
    'default' => env('COMPASS_DEFAULT_BOT', 'main'),

    'bots' => [
        'main' => [
            'token' => env('COMPASS_BOT_TOKEN'),
        ],
    ],

    'base_url' => rtrim(env('COMPASS_BASE_URL', 'https://userbot.getcompass.com/'), '/') . '/api/v3/',
    'timeout' => 10,
];
```

Multiple bots are supported — add more keys under `bots` and reference them via `'bot' => 'key_name'` in your notification.

Usage
-----

[](#usage)

### Route notification from a model

[](#route-notification-from-a-model)

```
class User extends Model
{
    use Notifiable;

    // Return user_id (int) to send as DM
    public function routeNotificationForCompass(): ?int
    {
        return $this->compass_user_id;
    }
}
```

The return value determines the recipient:

- `int` — treated as `user_id` (direct message)
- `string` — treated as `group_id`
- `array` — merged into notification data (`['user_id' => ..., 'group_id' => ...]`)

### Create a notification

[](#create-a-notification)

```
class WelcomeNotification extends Notification
{
    public function via($notifiable): array
    {
        return ['compass'];
    }

    public function toCompass($notifiable): array
    {
        return [
            'type' => 'text',
            'text' => "Welcome, {$notifiable->name}!",
        ];
    }
}
```

### Send to a group (on-demand)

[](#send-to-a-group-on-demand)

```
Notification::route('compass', ['group_id' => $groupId])
    ->notify(new WelcomeNotification());
```

### Send a file to a thread

[](#send-a-file-to-a-thread)

```
public function toCompass($notifiable): array
{
    return [
        'type' => 'file',
        'file' => '/path/to/document.pdf',
        'message_id' => $this->threadId,
    ];
}
```

The file is automatically uploaded via `file/getUrl` and the resulting `file_id` is sent.

### Use a specific bot

[](#use-a-specific-bot)

```
public function toCompass($notifiable): array
{
    return [
        'bot' => 'marketing', // key from config('compass.bots')
        'type' => 'text',
        'text' => 'Hello from marketing bot!',
    ];
}
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance85

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

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

Total

2

Last Release

75d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/40985d5041e17656df8a2b7722ad54b84fadef265fd03735787af5ab19f97585?d=identicon)[margas102](/maintainers/margas102)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rocont-laravel-notification-channel-compass/health.svg)

```
[![Health](https://phpackages.com/badges/rocont-laravel-notification-channel-compass/health.svg)](https://phpackages.com/packages/rocont-laravel-notification-channel-compass)
```

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[laravel-notification-channels/fcm

FCM (Firebase Cloud Messaging) Notifications Driver for Laravel

5917.0M16](/packages/laravel-notification-channels-fcm)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/microsoft-teams

A Laravel Notification Channel for Microsoft Teams

1603.0M7](/packages/laravel-notification-channels-microsoft-teams)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[laravel-notification-channels/aws-sns

Amazon Simple Notification Service (AWS SNS) notification channel for Laravel.

541.1M2](/packages/laravel-notification-channels-aws-sns)

PHPackages © 2026

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