- How do I install this package in a Laravel project?
- Run `composer require littleredbutton/bigbluebutton-api-php` in your project directory. The package supports PHP 8.1+ and Laravel’s service container. Configure your `.env` with `BBB_URL` and `BBB_SECRET` for API credentials, then bind the client to Laravel’s container in a service provider.
- Does this package support OAuth 2.0 alongside JWT for BigBlueButton authentication?
- The package primarily supports JWT authentication via the `BBB_SECRET`. OAuth 2.0 isn’t natively included, but you can extend the client by implementing a custom `Transport` class or middleware to handle OAuth flows. Laravel’s Sanctum or Passport can integrate with BBB’s OAuth if configured separately.
- Can I use Laravel’s HTTP client instead of the package’s default CurlTransport?
- Yes. The package supports PSR-18 HTTP clients, including Laravel’s built-in `Http` facade. Replace the default `CurlTransport` with `SymfonyHttpClientTransport` or `PsrHttpClientTransport` in the client configuration. This allows you to leverage Laravel’s middleware, retries, and logging.
- How do I handle rate limiting or API throttling from BigBlueButton?
- The package doesn’t include built-in retry logic, but you can wrap API calls in Laravel’s `retry` helper or use middleware like `retry-after` to handle rate limits. For example, add a `RetryAfterMiddleware` to your HTTP client to automatically delay requests when BBB returns a `429 Too Many Requests` response.
- Is there a way to cache meeting or recording data to reduce API calls?
- Yes. Store frequently accessed data (e.g., meeting IDs, recording metadata) in Laravel’s database using Eloquent models. Use Laravel’s cache driver (`Cache::remember`) to temporarily store responses. For recordings, cache playback URLs with a short TTL, as they may expire or require re-authentication.
- Does the package support webhooks for real-time BigBlueButton events (e.g., meeting started/ended)?
- The package doesn’t include webhook handling, but you can integrate BBB’s webhooks with Laravel’s `queue:listen` or `bus:listen`. Verify payloads using HMAC signatures (if enabled in BBB) and process events asynchronously via Laravel queues. Example: Dispatch a `MeetingStarted` event when a webhook is received.
- What Laravel versions does this package officially support?
- The package is designed for Laravel 8.x and 9.x, leveraging PHP 8.1+. While it may work with Laravel 10+, test thoroughly for compatibility, especially with changes to Laravel’s HTTP client or service container. Check the package’s `composer.json` for exact PHP/Laravel requirements.
- How do I create and manage recordings programmatically?
- Use the `createMeeting` method to start a meeting with recording enabled, then fetch recordings via `getRecordings()`. Publish recordings with `publishRecording($meetingId, $publish)` and delete them with `deleteRecording($meetingId)`. Cache recording metadata in Laravel to avoid repeated API calls for playback URLs.
- Are there any alternatives to this package for Laravel/BigBlueButton integration?
- Alternatives include using BBB’s raw REST API with Laravel’s HTTP client or third-party SDKs like `bigbluebutton/bigbluebutton-api`. However, this package offers a typed, Laravel-friendly wrapper with built-in error handling and support for common use cases like meetings, recordings, and monitoring.
- How do I test this package in a Laravel application before production?
- Use Laravel’s `Http` facade to mock BBB API responses in tests. For example, create a `BigBlueButtonApi` facade binding and stub responses with `Http::fake()`. Test edge cases like invalid credentials, rate limits, and webhook payloads. The package includes unit tests for core functionality, which you can adapt for your Laravel app.