littleredbutton/bigbluebutton-api-php
PHP client for the BigBlueButton API. Create and manage meetings, join URLs, recordings, and server calls from your Laravel or PHP app with a simple, typed wrapper around BBB endpoints and responses.
Installation
composer require littleredbutton/bigbluebutton-api-php
Add the service provider to config/app.php:
'providers' => [
// ...
LittleRedButton\BigBlueButton\BigBlueButtonServiceProvider::class,
],
Configuration Publish the config file:
php artisan vendor:publish --provider="LittleRedButton\BigBlueButton\BigBlueButtonServiceProvider"
Update .env with your BBB server URL, secret, and credentials:
BBB_URL=https://your-bbb-server.com/bigbluebutton-api
BBB_SECRET=your-secret-key
First Use Case: Create a Meeting
use LittleRedButton\BigBlueButton\BigBlueButton;
$bbb = app(BigBlueButton::class);
$meeting = $bbb->createMeeting([
'name' => 'Team Sync',
'meetingID' => 'team-sync-2025',
'attendeePW' => 'password123',
'moderatorPW' => 'moderator123',
]);
Meeting Management
$meeting = $bbb->createMeeting($params);
$joinUrl = $bbb->getJoinUrl($meeting['meetingID']);
$activeMeetings = $bbb->getMeetings(['state:active']);
User & Session Control
$bbb->kickUser($meetingId, $userId);
$bbb->muteUser($meetingId, $userId, true);
Webhooks & Events
started, ended):
$bbb->subscribeToEvents('meeting-started', function ($payload) {
// Handle event (e.g., log, notify Slack)
});
Recording Management
$bbb->publishRecording($meetingId, $recordId);
$bbb->deleteRecording($recordId);
dispatch(new ProcessRecordingJob($recordId));
$meetings = Cache::remember("bbb_meetings_{$state}", now()->addMinutes(5), fn() =>
$bbb->getMeetings(['state:' => $state])
);
Route::middleware(['auth:admin'])->group(function () {
Route::post('/bbb/meetings', [MeetingController::class, 'create']);
});
Rate Limiting
try {
$response = $bbb->createMeeting($params);
} catch (RateLimitException $e) {
sleep($e->retryAfter);
retry();
}
Secret Key Security
BBB_SECRET in code. Use Laravel’s .env and validate it’s set:
if (!config('bbb.secret')) {
throw new \RuntimeException('BBB secret not configured!');
}
Meeting ID Conflicts
meetingID is unique. Use UUIDs or timestamps:
$meetingId = 'meeting-' . Str::uuid()->toString();
Webhook Verification
$payload = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_BBB_SIGNATURE'];
if (!$bbb->verifyWebhook($payload, $signature)) {
abort(403, 'Invalid webhook signature');
}
debug: true in config/bbb.php to log raw API responses:
'debug' => env('BBB_DEBUG', false),
$bbb->getLastResponse() for errors:
if ($bbb->getLastResponse()->failed()) {
Log::error('BBB API Error:', ['response' => $bbb->getLastResponse()->json()]);
}
Custom API Clients
Extend LittleRedButton\BigBlueButton\Client to add methods:
class CustomBbbClient extends Client {
public function customMethod($param) {
return $this->post('/custom-endpoint', $param);
}
}
Event Handlers Bind custom logic to BBB events:
event(new MeetingStarted($meetingId));
Recording Processing
Use Laravel’s finished events to trigger post-processing:
$bbb->onRecordingFinished($recordId, function ($record) {
// Upload to S3, notify users, etc.
});
Fallback for Offline BBB Implement a fallback queue for critical actions (e.g., meeting creation):
if (!$bbb->isOnline()) {
Queue::later(now()->addMinutes(5), new RetryMeetingCreationJob($params));
}
How can I help you explore Laravel packages today?