PHPackages                             tedakis/pumble-sdk-php - 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. tedakis/pumble-sdk-php

ActiveLibrary[API Development](/categories/api)

tedakis/pumble-sdk-php
======================

PHP SDK for Pumble API with Laravel support

1.0.0(6mo ago)00MITPHPPHP ^8.1

Since Oct 26Pushed 6mo agoCompare

[ Source](https://github.com/tbon77/pumble-sdk-laravel-php)[ Packagist](https://packagist.org/packages/tedakis/pumble-sdk-php)[ RSS](/packages/tedakis-pumble-sdk-php/feed)WikiDiscussions master Synced 1mo ago

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

Pumble SDK for PHP/Laravel
==========================

[](#pumble-sdk-for-phplaravel)

A modern PHP SDK for the Pumble API with first-class Laravel support. Read channel messages, send messages, manage channels, and more.

[![Latest Version](https://camo.githubusercontent.com/041cae83f7dc38d8da46b19a00c40a3b8b251886cb7c641ad47ae4945a5a302e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746564616b69732f70756d626c652d73646b2d7068702e737667)](https://packagist.org/packages/tedakis/pumble-sdk-php)[![License](https://camo.githubusercontent.com/49d1d75b22c0604fd06333c16a060e77487b6fcb744e3fb8b99b172492f9cd46/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f746564616b69732f70756d626c652d73646b2d7068702e737667)](https://packagist.org/packages/tedakis/pumble-sdk-php)[![PHP Version](https://camo.githubusercontent.com/12766a8c89edbbe490b96a990bd8748f359f7a9a3c2486a8d129ea82e353dd1a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f746564616b69732f70756d626c652d73646b2d7068702e737667)](https://packagist.org/packages/tedakis/pumble-sdk-php)

Features
--------

[](#features)

- Read channel messages with pagination support
- Send messages and replies
- Manage channels (create, list)
- User management (list users)
- Add reactions to messages
- Search and filter messages
- Type-safe DTOs (Data Transfer Objects)
- Laravel service provider and facade
- Comprehensive error handling

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 10.x or 11.x

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

[](#installation)

Install the package via Composer:

```
composer require tedakis/pumble-sdk-php
```

### Laravel Auto-Discovery

[](#laravel-auto-discovery)

The package will automatically register its service provider and facade.

### Publish Configuration (Optional)

[](#publish-configuration-optional)

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

This will create a `config/pumble.php` file.

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

[](#configuration)

### Get Your API Key

[](#get-your-api-key)

1. Open Pumble
2. Run the command: `/api-keys generate`
3. Copy the API key from the ephemeral message

### Add to .env

[](#add-to-env)

```
PUMBLE_API_KEY=your-api-key-here
```

Usage
-----

[](#usage)

### Using the Facade (Laravel)

[](#using-the-facade-laravel)

```
use Tedakis\PumbleSDK\Facades\Pumble;

// Get messages from a channel
$messages = Pumble::getAllMessages('general');

foreach ($messages as $message) {
    echo "{$message->userId}: {$message->text}\n";
}

// Send a message
Pumble::sendMessage('general', 'Hello from Laravel!');

// Search messages
$results = Pumble::searchMessages('general', 'important');

// List all channels
$channels = Pumble::getChannels();
```

### Using Dependency Injection (Laravel)

[](#using-dependency-injection-laravel)

```
use Tedakis\PumbleSDK\PumbleService;

class MessageController extends Controller
{
    public function __construct(
        private PumbleService $pumble
    ) {}

    public function index(string $channel)
    {
        $messages = $this->pumble->getAllMessages($channel);

        return view('messages.index', compact('messages'));
    }
}
## API Reference

### Reading Messages

#### Get Messages with Pagination

```php
// Get first page
$collection = Pumble::getMessages('general', limit: 50);

foreach ($collection->getMessages() as $message) {
    // Process message
}

// Get next page if available
if ($collection->hasMore()) {
    $nextPage = Pumble::getMessages('general', cursor: $collection->getCursor());
}
```

#### Get All Messages (Auto-pagination)

[](#get-all-messages-auto-pagination)

```
// Automatically handles pagination
$allMessages = Pumble::getAllMessages('general');
```

#### Search Messages

[](#search-messages)

```
$results = Pumble::searchMessages('general', 'search term');
```

#### Get Messages by User

[](#get-messages-by-user)

```
$userMessages = Pumble::getMessagesByUser('general', 'user-id-123');
```

### Channels

[](#channels)

```
// List all channels
$channels = Pumble::getChannels();

// Create a new channel
Pumble::createChannel('new-channel', isPrivate: false);
```

### Users

[](#users)

```
// List all users
$users = Pumble::getUsers();

foreach ($users as $user) {
    echo "{$user->name} ({$user->email})\n";
}
```

### Sending Messages

[](#sending-messages)

```
// Send as bot (default)
Pumble::sendMessage('general', 'Hello!');

// Send as your personal account
Pumble::sendMessage('general', 'Hello!', asBot: false);

// Reply to a message
Pumble::replyToMessage('general', 'message-id', 'This is a reply');
```

### Reactions

[](#reactions)

```
// Add a reaction
Pumble::addReaction('general', 'message-id', 'thumbsup');
Pumble::addReaction('general', 'message-id', 'heart');
```

### Delete Messages

[](#delete-messages)

```
Pumble::deleteMessage('general', 'message-id');
```

Data Transfer Objects
---------------------

[](#data-transfer-objects)

### Message

[](#message)

```
$message->id           // Message ID
$message->text         // Message content
$message->channelId    // Channel ID
$message->userId       // User ID
$message->createdAt    // Creation timestamp
$message->updatedAt    // Update timestamp (nullable)
$message->reactions    // Array of reactions (nullable)
$message->threadId     // Thread ID (nullable)
$message->mentions     // Mentioned users (nullable)
$message->attachments  // Message attachments (nullable)
```

### Channel

[](#channel)

```
$channel->id          // Channel ID
$channel->name        // Channel name
$channel->isPrivate   // Is private channel
$channel->description // Description (nullable)
$channel->createdAt   // Creation timestamp (nullable)
$channel->members     // Member IDs (nullable)
```

### User

[](#user)

```
$user->id         // User ID
$user->name       // Display name
$user->email      // Email address
$user->avatarUrl  // Avatar URL (nullable)
$user->isBot      // Is bot account (nullable)
$user->status     // User status (nullable)
```

Advanced Examples
-----------------

[](#advanced-examples)

### Export Messages to JSON

[](#export-messages-to-json)

```
$messages = Pumble::getAllMessages('general');

$exported = $messages->map(fn($m) => [
    'id' => $m->id,
    'text' => $m->text,
    'user' => $m->userId,
    'timestamp' => $m->createdAt,
])->toArray();

file_put_contents('messages.json', json_encode($exported, JSON_PRETTY_PRINT));
```

### Find Most Active Users

[](#find-most-active-users)

```
$messages = Pumble::getAllMessages('general');

$activity = $messages->groupBy('userId')
    ->map(fn($msgs) => $msgs->count())
    ->sortDesc();

foreach ($activity as $userId => $count) {
    echo "User {$userId}: {$count} messages\n";
}
```

### Message Statistics

[](#message-statistics)

```
$messages = Pumble::getAllMessages('general');

$stats = [
    'total' => $messages->count(),
    'with_reactions' => $messages->filter(fn($m) => !empty($m->reactions))->count(),
    'in_threads' => $messages->filter(fn($m) => $m->threadId !== null)->count(),
];
```

Error Handling
--------------

[](#error-handling)

```
use Tedakis\PumbleSDK\Exceptions\PumbleException;

try {
    $messages = Pumble::getMessages('general');
} catch (PumbleException $e) {
    Log::error('Pumble API Error', [
        'message' => $e->getMessage(),
        'code' => $e->getCode(),
    ]);
}
```

Testing
-------

[](#testing)

```
composer test
```

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

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance66

Regular maintenance activity

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

202d ago

### Community

Maintainers

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

---

Tags

apilaravelsdkmessagingchatpumble

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tedakis-pumble-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/tedakis-pumble-sdk-php/health.svg)](https://phpackages.com/packages/tedakis-pumble-sdk-php)
```

###  Alternatives

[resend/resend-laravel

Resend for Laravel

1191.4M6](/packages/resend-resend-laravel)

PHPackages © 2026

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