### session() usage example Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Example call to session() with a session ID. ```php $session = LivestormClient::session('session-id'); ``` -------------------------------- ### sessions() usage example Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Example call to sessions() with page and perPage parameters. ```php $sessions = LivestormClient::sessions(page: 1, perPage: 100); ``` -------------------------------- ### Install via Composer Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/README.md Install the package using Composer. ```bash composer require jeffersongoncalves/laravel-livestorm ``` -------------------------------- ### Usage examples Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/README.md Examples of using the Livestorm client for health checks, events, sessions, people, and webhooks. ```php use JeffersonGoncalves\Livestorm\LivestormClient; // Health check LivestormClient::ping(); LivestormClient::organization(); // Events $events = LivestormClient::events(title: 'Product Launch'); $event = LivestormClient::event('event-id'); $event = LivestormClient::createEvent('Product Launch', description: 'Q4 launch webinar'); LivestormClient::updateEvent('event-id', title: 'Product Launch 2.0'); LivestormClient::deleteEvent('event-id'); $attendees = LivestormClient::eventPeople('event-id'); // Sessions $sessions = LivestormClient::sessions(); $session = LivestormClient::createSession('event-id', estimatedStartedAt: '2026-10-01T10:00:00Z'); LivestormClient::registerToSession('session-id', 'jane@example.com', firstName: 'Jane', lastName: 'Doe'); LivestormClient::unregisterFromSession('session-id', 'jane@example.com'); $recordings = LivestormClient::sessionRecordings('session-id'); // People $people = LivestormClient::people(email: 'jane@example.com'); // Webhooks LivestormClient::createWebhook('https://example.com/webhooks/livestorm', event: 'attendance'); ``` -------------------------------- ### events() usage examples Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Calls events() without arguments to get all events, and with title and perPage to filter by exact title and set page size. ```php $events = LivestormClient::events(); $launch = LivestormClient::events(title: 'Product Launch', perPage: 50); // filter[title] + page[size] ``` -------------------------------- ### sessionRecordings() usage example Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Example call to retrieve recordings for a session ID. ```php $recordings = LivestormClient::sessionRecordings('session-id'); ``` -------------------------------- ### createSession() usage examples Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Two calls to `createSession()`: the first creates a session with only the event ID; the second includes an estimated start time and timezone using named arguments. ```php $session = LivestormClient::createSession('event-id'); $sched = LivestormClient::createSession('event-id', estimatedStartedAt: '2026-10-01T10:00:00Z', timezone: 'Europe/Lisbon'); ``` -------------------------------- ### Example .env Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/configuration.md Example environment variables for configuring the Livestorm package. LIVESTORM_API_TOKEN is required; LIVESTORM_BASE_URL defaults to https://api.livestorm.co/v1; LIVESTORM_TIMEOUT defaults to 8. ```env LIVESTORM_API_TOKEN=your-api-token LIVESTORM_BASE_URL=https://api.livestorm.co/v1 LIVESTORM_TIMEOUT=8 ``` -------------------------------- ### person() usage example Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Example call to retrieve a person resource by ID. ```php $person = LivestormClient::person('person-id'); ``` -------------------------------- ### people() usage examples Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Two example calls: one without filters, one with email filter. ```php $people = LivestormClient::people(); $jane = LivestormClient::people(email: 'jane@example.com'); ``` -------------------------------- ### webhooks() usage example Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Calls the static webhooks() method to fetch all webhook resources. ```php $webhooks = LivestormClient::webhooks(); ``` -------------------------------- ### organization() usage example Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Calls LivestormClient::organization() and stores the result. ```php $org = LivestormClient::organization(); ``` -------------------------------- ### createWebhook() usage examples Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Calls createWebhook() with a URL and optionally with a custom event name using a named argument. ```php $webhook = LivestormClient::createWebhook('https://example.com/webhooks/livestorm'); $webhook = LivestormClient::createWebhook('https://example.com/hooks', event: 'registration'); ``` -------------------------------- ### eventPeople() usage example Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Example call to eventPeople() with perPage set to 100. ```php $attendees = LivestormClient::eventPeople('event-id', perPage: 100); ``` -------------------------------- ### createEvent() usage examples Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Shows two calls to `LivestormClient::createEvent()`: one with only the title, and one with all optional parameters. ```php $event = LivestormClient::createEvent('Product Launch'); $event = LivestormClient::createEvent('Launch', slug: 'launch', description: 'Q4', estimatedDuration: 45); ``` -------------------------------- ### deleteWebhook() usage example Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Calls deleteWebhook() with a webhook resource ID. ```php $deleted = LivestormClient::deleteWebhook('webhook-id'); ``` -------------------------------- ### registerToSession() usage examples Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Shows two calls to registerToSession: one with only session ID and email, and another with named arguments for first and last name. ```php $person = LivestormClient::registerToSession('session-id', 'jane@example.com'); LivestormClient::registerToSession('session-id', 'jane@example.com', firstName: 'Jane', lastName: 'Doe'); ``` -------------------------------- ### GET /sessions/{id}/questions Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/endpoints.md List questions for a session. Supports pagination. ```APIDOC ## GET /sessions/{id}/questions ### Description List questions for a session. ### Method GET ### Endpoint /sessions/{id}/questions ### Parameters #### Path Parameters - **id** (string) - Required - The session ID. #### Query Parameters - **page[number]** (integer) - Optional - Page number. - **page[size]** (integer) - Optional - Items per page. ### Response #### Success Response (2xx) - **data** (array) - List of questions. #### Response Example [] ``` -------------------------------- ### ping() usage example Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Calls LivestormClient::ping() and stores the result, e.g. ['status' => 'ok']. ```php $status = LivestormClient::ping(); // e.g. ['status' => 'ok'] ``` -------------------------------- ### GET /webhooks Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/endpoints.md List all webhooks. Returns a list of webhook objects. ```APIDOC ## GET /webhooks ### Description List all webhooks. ### Method GET ### Endpoint /webhooks ### Response #### Success Response (2xx) - **data** (array) - List of webhooks. #### Response Example [] ``` -------------------------------- ### GET /sessions Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/endpoints.md List sessions with optional pagination. Returns a list of session objects. ```APIDOC ## GET /sessions ### Description List sessions with optional pagination. ### Method GET ### Endpoint /sessions ### Parameters #### Query Parameters - **page[number]** (integer) - Optional - Page number. - **page[size]** (integer) - Optional - Items per page. ### Response #### Success Response (2xx) - **data** (array) - List of session objects. #### Response Example [] ``` -------------------------------- ### organization() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Declares the static organization() method that returns an array or null. It calls GET {base_url}/organization with no parameters. ```php /** * @return array|null */ public static function organization(): ?array ``` -------------------------------- ### event() usage examples Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Shows how to call `LivestormClient::event()` with a valid ID and check for null when the event is missing. ```php $event = LivestormClient::event('event-id'); if (LivestormClient::event('missing') === null) { // Not found or request failed. } ``` -------------------------------- ### sessions() Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Retrieves a paginated list of session resources. This method maps to the GET /sessions endpoint. ```APIDOC ## GET /sessions ### Description Retrieves a paginated list of session resources. ### Method GET ### Endpoint `{base_url}/sessions` ### Parameters #### Query Parameters - **page[number]** (int) - Optional - Page number. Default: 1. - **page[size]** (int) - Optional - Number of items per page. Default: 25. ### Request Example ``` GET /sessions?page[number]=1&page[size]=25 ``` ### Response #### Success Response (200) - **body** (array) - List of session resources, or empty array. #### Response Example ```json [] ``` ``` -------------------------------- ### GET /sessions/{id}/recordings Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/endpoints.md List recordings for a session. Returns a list of recording objects. ```APIDOC ## GET /sessions/{id}/recordings ### Description List recordings for a session. ### Method GET ### Endpoint /sessions/{id}/recordings ### Parameters #### Path Parameters - **id** (string) - Required - The session ID. ### Response #### Success Response (2xx) - **data** (array) - List of recordings. #### Response Example [] ``` -------------------------------- ### Direct static call to LivestormClient Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-facade.md Because LivestormClient is entirely static, the facade is optional. This snippet shows calling LivestormClient::events() directly without any container setup. ```php use JeffersonGoncalves\Livestorm\LivestormClient; $events = LivestormClient::events(); ``` -------------------------------- ### sessions() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Static method to fetch session resources. Calls GET {base_url}/sessions. Parameters: $page (default 1), $perPage (default 25). Returns list of arrays or empty array. ```php /** * @return list> */ public static function sessions(int $page = 1, int $perPage = 25): array ``` -------------------------------- ### deleteSession() usage example Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Deletes a session with the given ID and stores the boolean result in `$deleted`. ```php $deleted = LivestormClient::deleteSession('session-id'); ``` -------------------------------- ### Binding the 'livestorm' container key in a host service provider Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-facade.md The package does not register the 'livestorm' container binding, so calling Livestorm::events() without setup throws RuntimeException: A facade root has not been set. This snippet shows how a host application can bind the key to LivestormClient to make the facade functional. ```php // In a service provider of the host application: $this->app->singleton('livestorm', \JeffersonGoncalves\Livestorm\LivestormClient::class); ``` -------------------------------- ### GET /people Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/endpoints.md List people with optional pagination and email filter. Returns a list of people. ```APIDOC ## GET /people ### Description List people with optional pagination and email filter. ### Method GET ### Endpoint /people ### Parameters #### Query Parameters - **page[number]** (integer) - Optional - Page number. - **page[size]** (integer) - Optional - Items per page. - **filter[email]** (string) - Optional - Filter by email. ### Response #### Success Response (2xx) - **data** (array) - List of people. #### Response Example [] ``` -------------------------------- ### GET /people/{id} Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/endpoints.md Retrieve a single person by ID. Returns the person object. ```APIDOC ## GET /people/{id} ### Description Retrieve a single person by ID. ### Method GET ### Endpoint /people/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The person ID. ### Response #### Success Response (2xx) - **data** (?array) - The person object. #### Response Example {} ``` -------------------------------- ### session() Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Retrieves a single session resource by its ID. This method maps to the GET /sessions/{id} endpoint. ```APIDOC ## GET /sessions/{id} ### Description Retrieves a single session resource by its ID. ### Method GET ### Endpoint `{base_url}/sessions/{id}` ### Parameters #### Path Parameters - **id** (string) - Required - Session resource ID. ### Request Example ``` GET /sessions/{id} ``` ### Response #### Success Response (200) - **body** (object|null) - The session resource, or null on failure. #### Response Example ```json null ``` ``` -------------------------------- ### sessionQuestions() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Declares the static method signature for retrieving Q&A questions from a session. It sends a GET request to `{base_url}/sessions/{$id}/questions` and returns a list of arrays, or an empty array if none exist. ```php /** * @return list> */ public static function sessionQuestions(string $id, int $page = 1, int $perPage = 25): array ``` -------------------------------- ### GET /sessions/{id} Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/endpoints.md Retrieve a single session by its ID. Returns the session object. ```APIDOC ## GET /sessions/{id} ### Description Retrieve a single session by its ID. ### Method GET ### Endpoint /sessions/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The session ID. ### Response #### Success Response (2xx) - **data** (?array) - The session object. #### Response Example {} ``` -------------------------------- ### person() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Static method to fetch a single person by ID. Calls GET {base_url}/people/{$id}. Returns array or null on failure. ```php /** * @return array|null */ public static function person(string $id): ?array ``` -------------------------------- ### session() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Static method to fetch a single session resource. Calls GET {base_url}/sessions/{$id}. Parameter: $id (required). Returns array or null on failure. ```php /** * @return array|null */ public static function session(string $id): ?array ``` -------------------------------- ### GET /sessions/{id}/chat-messages Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/endpoints.md List chat messages for a session. Supports pagination. ```APIDOC ## GET /sessions/{id}/chat-messages ### Description List chat messages for a session. ### Method GET ### Endpoint /sessions/{id}/chat-messages ### Parameters #### Path Parameters - **id** (string) - Required - The session ID. #### Query Parameters - **page[number]** (integer) - Optional - Page number. - **page[size]** (integer) - Optional - Items per page. ### Response #### Success Response (2xx) - **data** (array) - List of chat messages. #### Response Example [] ``` -------------------------------- ### sessionRecordings() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Static method to fetch session recordings. Calls GET {base_url}/sessions/{$id}/recordings without paging. Returns list of arrays or empty array. ```php /** * @return list> */ public static function sessionRecordings(string $id): array ``` -------------------------------- ### Runtime override of config values Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/configuration.md Because the client reads config() per request, a host application can override at runtime before calling. This example sets a rotated token and a timeout of 15 seconds, then calls the events endpoint. ```php config([ 'livestorm.api_token' => 'rotated-token', 'livestorm.timeout' => 15, ]); $events = \JeffersonGoncalves\Livestorm\LivestormClient::events(); ``` -------------------------------- ### GET /events Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/endpoints.md List events with optional pagination and title filter. Returns a list of event objects. ```APIDOC ## GET /events ### Description List events with optional pagination and title filter. ### Method GET ### Endpoint /events ### Parameters #### Query Parameters - **page[number]** (integer) - Optional - Page number for pagination. - **page[size]** (integer) - Optional - Number of items per page. - **filter[title]** (string) - Optional - Filter events by title. ### Response #### Success Response (2xx) - **data** (array) - List of event objects. #### Response Example [] ``` -------------------------------- ### sessionQuestions() usage example Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Calls `LivestormClient::sessionQuestions()` with a session ID. The `$page` parameter defaults to 1 and `$perPage` defaults to 25. ```php $questions = LivestormClient::sessionQuestions('session-id'); ``` -------------------------------- ### GET /events/{id} Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/endpoints.md Retrieve a single event by its ID. Returns the event object. ```APIDOC ## GET /events/{id} ### Description Retrieve a single event by its ID. ### Method GET ### Endpoint /events/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The event ID. ### Response #### Success Response (2xx) - **data** (?array) - The event object. #### Response Example {} ``` -------------------------------- ### GET /sessions/{id}/people Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/endpoints.md List people registered for a specific session. Supports pagination. ```APIDOC ## GET /sessions/{id}/people ### Description List people registered for a specific session. ### Method GET ### Endpoint /sessions/{id}/people ### Parameters #### Path Parameters - **id** (string) - Required - The session ID. #### Query Parameters - **page[number]** (integer) - Optional - Page number. - **page[size]** (integer) - Optional - Items per page. ### Response #### Success Response (2xx) - **data** (array) - List of people. #### Response Example [] ``` -------------------------------- ### deleteEvent() usage example Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Calls deleteEvent() and checks the boolean result to handle failure or non-2xx status. ```php $deleted = LivestormClient::deleteEvent('event-id'); if (! $deleted) { // Request failed or non-2xx status. } ``` -------------------------------- ### sessionPeople() usage example Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Calls the sessionPeople method with a session ID to fetch registrants. The result is assigned to the variable $registrants. ```php $registrants = LivestormClient::sessionPeople('session-id'); ``` -------------------------------- ### organization() Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Fetches the organization details from the Livestorm API by sending a GET request to the /organization endpoint. Returns the decoded response body. ```APIDOC ## GET {base_url}/organization ### Description Fetches the organization details from the Livestorm API by sending a GET request to the /organization endpoint. Returns the decoded response body. ### Method GET ### Endpoint {base_url}/organization ### Parameters None ### Response #### Success Response (200) - **data** (array) - Decoded response body with 'data' unwrapped. #### Response Example ```json { "id": "org_123", "name": "Example Org" } ``` ``` -------------------------------- ### GET /ping Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/endpoints.md Ping the Livestorm API to check connectivity. Returns a plain JSON body. ```APIDOC ## GET /ping ### Description Ping the Livestorm API to check connectivity. ### Method GET ### Endpoint /ping ### Response #### Success Response (2xx) - **body** (?array) - Plain JSON body #### Response Example {} ``` -------------------------------- ### GET /events/{id}/people Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/endpoints.md List people registered for a specific event. Supports pagination. ```APIDOC ## GET /events/{id}/people ### Description List people registered for a specific event. ### Method GET ### Endpoint /events/{id}/people ### Parameters #### Path Parameters - **id** (string) - Required - The event ID. #### Query Parameters - **page[number]** (integer) - Optional - Page number. - **page[size]** (integer) - Optional - Items per page. ### Response #### Success Response (2xx) - **data** (array) - List of people. #### Response Example [] ``` -------------------------------- ### people() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Static method to fetch people with optional email filter and pagination. Calls GET {base_url}/people; adds filter[email] when email provided. Returns list of arrays or empty array. ```php /** * @return list> */ public static function people(?string $email = null, int $page = 1, int $perPage = 25): array ``` -------------------------------- ### updateEvent() usage examples Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Shows two ways to call updateEvent(): updating the title only, or patching only the description field. Parameters set to null are omitted from the request body. ```php LivestormClient::updateEvent('event-id', title: 'Product Launch 2.0'); LivestormClient::updateEvent('event-id', description: 'Only this field is patched'); ``` -------------------------------- ### webhooks() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Static method that retrieves webhook resources from GET {base_url}/webhooks without paging. Returns a list of associative arrays or an empty array. ```php /** * @return list> */ public static function webhooks(): array ``` -------------------------------- ### GET /organization Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/endpoints.md Retrieve organization information. Returns the `data` field unwrapped from the JSON:API response. ```APIDOC ## GET /organization ### Description Retrieve organization information. ### Method GET ### Endpoint /organization ### Response #### Success Response (2xx) - **data** (?array) - Unwrapped `data` field #### Response Example {} ``` -------------------------------- ### sessionChatMessages() usage example Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Calls `LivestormClient::sessionChatMessages()` with a session ID and sets `perPage` to 50. The `$page` parameter defaults to 1 and `$perPage` defaults to 25. ```php $messages = LivestormClient::sessionChatMessages('session-id', perPage: 50); ``` -------------------------------- ### unregisterFromSession() usage example Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Calls `LivestormClient::unregisterFromSession()` with a session ID and an email address. The email is URL-encoded into the `filter[email]` query parameter. ```php $removed = LivestormClient::unregisterFromSession('session-id', 'jane@example.com'); ``` -------------------------------- ### ping() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Declares the static ping() method that returns an array or null. It calls GET {base_url}/ping and returns the decoded body with data unwrapped, or null on non-2xx, non-array body, or transport failure. ```php /** * @return array|null */ public static function ping(): ?array ``` -------------------------------- ### ping() Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Checks the Livestorm API connectivity by sending a GET request to the /ping endpoint. Returns the decoded response body or null on failure. ```APIDOC ## GET {base_url}/ping ### Description Checks the Livestorm API connectivity by sending a GET request to the /ping endpoint. Returns the decoded response body or null on failure. ### Method GET ### Endpoint {base_url}/ping ### Parameters None ### Response #### Success Response (200) - **data** (array) - Decoded response body with 'data' unwrapped. #### Response Example ```json { "status": "ok" } ``` ### Error Handling Returns `null` on non-2xx status, non-array body, or transport failure. ``` -------------------------------- ### sessionPeople() Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Retrieves the list of registered people for a given session. This method corresponds to the GET request to the /sessions/{id}/people endpoint. ```APIDOC ## [GET] /sessions/{id}/people ### Description Retrieves the list of registered people for a given session. ### Method GET ### Endpoint {base_url}/sessions/{id}/people ### Parameters #### Path Parameters - **id** (string) - Required - Session resource ID. #### Query Parameters - **page[number]** (int) - Optional - Page number, defaults to 1. - **page[size]** (int) - Optional - Number of items per page, defaults to 25. ### Response #### Success Response (200) Returns a list of registered people, or an empty array if none. #### Response Example ```json [] ``` ``` -------------------------------- ### events() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Declares the static events() method that returns a list of arrays. It calls GET {base_url}/events, adding filter[title] when $title is not null, and supports pagination via page[number] and page[size]. ```php /** * @return list> */ public static function events(?string $title = null, int $page = 1, int $perPage = 25): array ``` -------------------------------- ### Run code formatting Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/README.md Run Pint code formatting. ```bash composer format ``` -------------------------------- ### webhooks() Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Retrieves a list of webhook resources from the Livestorm API. This method makes a GET request to the /webhooks endpoint and returns an array of webhook data, or an empty array if none exist. ```APIDOC ## GET {base_url}/webhooks ### Description Retrieves a list of webhook resources from the Livestorm API. ### Method GET ### Endpoint {base_url}/webhooks ### Parameters None. ### Response #### Success Response (200) - **webhooks** (list>) - List of webhook resources, or empty array. #### Response Example ```json [] ``` ``` -------------------------------- ### eventPeople() Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Retrieves the list of people associated with a specific event. This method maps to the GET /events/{id}/people endpoint. ```APIDOC ## GET /events/{id}/people ### Description Retrieves the list of people associated with a specific event. ### Method GET ### Endpoint `{base_url}/events/{id}/people` ### Parameters #### Path Parameters - **id** (string) - Required - Event resource ID. #### Query Parameters - **page[number]** (int) - Optional - Page number. Default: 1. - **page[size]** (int) - Optional - Number of items per page. Default: 25. ### Request Example ``` GET /events/{id}/people?page[number]=1&page[size]=25 ``` ### Response #### Success Response (200) - **body** (array) - List of people associated with the event, or empty array. #### Response Example ```json [] ``` ``` -------------------------------- ### eventPeople() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Static method to fetch people associated with an event. Calls GET {base_url}/events/{$id}/people. Parameters: $id (required), $page (default 1), $perPage (default 25). Returns list of arrays or empty array. ```php /** * @return list> */ public static function eventPeople(string $id, int $page = 1, int $perPage = 25): array ``` -------------------------------- ### sessionChatMessages() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Declares the static method signature for retrieving chat messages from a session. It sends a GET request to `{base_url}/sessions/{$id}/chat-messages` and returns a list of arrays, or an empty array if none exist. ```php /** * @return list> */ public static function sessionChatMessages(string $id, int $page = 1, int $perPage = 25): array ``` -------------------------------- ### Catching LivestormAuthenticationException Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/errors.md Example of wrapping a client call in try/catch to handle the 401 exception. The catch block reports the exception message, which is 'Livestorm API authentication failed. Check the LIVESTORM_API_TOKEN credential.' ```php use JeffersonGoncalves\Livestorm\LivestormClient; use JeffersonGoncalves\Livestorm\Exceptions\LivestormAuthenticationException; try { $events = LivestormClient::events(); } catch (LivestormAuthenticationException $e) { // 401 — token missing, wrong, or revoked. report($e->getMessage()); // "Livestorm API authentication failed. Check the LIVESTORM_API_TOKEN credential." } ``` -------------------------------- ### Run static analysis Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/README.md Run PHPStan static analysis. ```bash composer analyse ``` -------------------------------- ### Run tests Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/README.md Run the test suite. ```bash composer test ``` -------------------------------- ### Config options Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/README.md Configuration file with API token, base URL, and timeout settings. ```php // config/livestorm.php return [ 'api_token' => env('LIVESTORM_API_TOKEN'), 'base_url' => env('LIVESTORM_BASE_URL', 'https://api.livestorm.co/v1'), 'timeout' => (int) env('LIVESTORM_TIMEOUT', 8), ]; ``` -------------------------------- ### Environment configuration Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/README.md Add your API token to the .env file. ```env LIVESTORM_API_TOKEN=your-api-token ``` -------------------------------- ### configurePackage method body Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-service-provider.md The declared body of the configurePackage method. It sets the package name to 'livestorm' and calls hasConfigFile() with no argument, so spatie looks for config/livestorm.php. ```php $package ->name('livestorm') ->hasConfigFile(); ``` -------------------------------- ### sessionQuestions() Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Retrieves Q&A questions for a given session. Supports pagination via page number and page size parameters. ```APIDOC ## GET {base_url}/sessions/{$id}/questions ### Description Retrieves Q&A questions for a given session. ### Method GET ### Endpoint `{base_url}/sessions/{$id}/questions` ### Parameters #### Path Parameters - **$id** (string) - Required - Session resource ID. #### Query Parameters - **page[number]** (int) - Optional - Page number, default `1`. - **page[size]** (int) - Optional - Page size, default `25`. ### Response #### Success Response (200) - Returns a list of Q&A questions, or `[]`. ### Example ```php $questions = LivestormClient::sessionQuestions('session-id'); ``` ``` -------------------------------- ### Using the facade after binding Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-facade.md After binding 'livestorm', proxied calls reach LivestormClient. Errors propagate unchanged: a 401 surfaces as LivestormAuthenticationException, and failed decodes return null / [] / false as documented on the client page. ```php use JeffersonGoncalves\Livestorm\Facades\Livestorm; // After binding 'livestorm', proxied calls reach LivestormClient: $events = Livestorm::events(); ``` -------------------------------- ### Publish livestorm config command Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-service-provider.md Publishes the package's configuration file under the tag 'livestorm-config' as stated in the project README. ```bash php artisan vendor:publish --tag="livestorm-config" ``` -------------------------------- ### createWebhook() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Static method that creates a webhook via POST {base_url}/webhooks with data containing type 'webhooks' and attributes target_url and event_name. The $event parameter defaults to 'attendance' and is not validated client-side. Returns the created webhook resource array or null on failure. ```php /** * @return array|null */ public static function createWebhook(string $url, string $event = 'attendance'): ?array ``` -------------------------------- ### createWebhook() Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Creates a new webhook subscription with the Livestorm API. This method sends a POST request to the /webhooks endpoint with the target URL and event name, and returns the created webhook resource or null on failure. ```APIDOC ## POST {base_url}/webhooks ### Description Creates a new webhook subscription with the Livestorm API. ### Method POST ### Endpoint {base_url}/webhooks ### Parameters #### Request Body - **data.type** (string) - Required - Always 'webhooks'. - **data.attributes.target_url** (string) - Required - The callback endpoint URL. - **data.attributes.event_name** (string) - Optional - The Livestorm event name (default: 'attendance'). ### Request Example ```json { "data": { "type": "webhooks", "attributes": { "target_url": "https://example.com/webhooks/livestorm", "event_name": "attendance" } } } ``` ### Response #### Success Response (200) - **webhook** (array|null) - The created webhook resource, or null on failure. #### Response Example ```json { "data": { "type": "webhooks", "id": "webhook-id", "attributes": { "target_url": "https://example.com/webhooks/livestorm", "event_name": "attendance" } } } ``` ``` -------------------------------- ### event() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Declares the static method `event()` that fetches an event by ID. Returns an array or null on failure, including 404. ```php /** * @return array|null */ public static function event(string $id): ?array ``` -------------------------------- ### createEvent() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Declares the static method `createEvent()` with optional parameters. Returns an array or null on failure. ```php /** * @return array|null */ public static function createEvent(string $title, ?string $slug = null, ?string $description = null, ?int $estimatedDuration = null): ?array ``` -------------------------------- ### createSession() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Static method to create a session for an event. Sends a POST request to `{base_url}/events/{$eventId}/sessions` with only non-null attributes (`estimated_started_at`, `timezone`). Returns the created session resource array or `null` on failure. ```php /** * @return array|null */ public static function createSession(string $eventId, ?string $estimatedStartedAt = null, ?string $timezone = null): ?array ``` -------------------------------- ### Default config/livestorm.php Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/configuration.md The package reads configuration exclusively from config/livestorm.php. This is the full source of the config file, defining api_token, base_url, and timeout with environment variable fallbacks. ```php env('LIVESTORM_API_TOKEN'), 'base_url' => env('LIVESTORM_BASE_URL', 'https://api.livestorm.co/v1'), 'timeout' => (int) env('LIVESTORM_TIMEOUT', 8), ]; ``` -------------------------------- ### registerToSession() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Defines the static method registerToSession that registers a person to a session. Parameters include session ID, email, and optional first and last names. Returns the created person resource or null on failure. ```php /** * @return array|null */ public static function registerToSession(string $id, string $email, ?string $firstName = null, ?string $lastName = null): ?array ``` -------------------------------- ### registerToSession() Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Registers a person to a session by creating a new person resource. This method corresponds to the POST request to the /sessions/{id}/people endpoint. ```APIDOC ## [POST] /sessions/{id}/people ### Description Registers a person to a session by creating a new person resource. ### Method POST ### Endpoint {base_url}/sessions/{id}/people ### Parameters #### Path Parameters - **id** (string) - Required - Session resource ID. #### Request Body - **data.type** (string) - Required - Must be "people". - **data.attributes.fields.email** (string) - Required - Registrant email. - **data.attributes.fields.first_name** (string) - Optional - First name, sent when not null. - **data.attributes.fields.last_name** (string) - Optional - Last name, sent when not null. ### Request Example ```json { "data": { "type": "people", "attributes": { "fields": { "email": "jane@example.com", "first_name": "Jane", "last_name": "Doe" } } } } ``` ### Response #### Success Response (200) Returns the created person resource, or null on failure. #### Response Example ```json { "data": { "type": "people", "id": "person-id", "attributes": { "email": "jane@example.com", "first_name": "Jane", "last_name": "Doe" } } } ``` ``` -------------------------------- ### createEvent(string $title, ?string $slug = null, ?string $description = null, ?int $estimatedDuration = null): ?array Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Creates a new event resource. The title is always sent; optional attributes are included only when provided. ```APIDOC ## POST {base_url}/events ### Description Creates a new event resource. ### Method POST ### Endpoint {base_url}/events ### Parameters #### Request Body - **title** (string) - Required - Event title, always sent. - **slug** (string|null) - Optional - Sent as `slug` when not null. - **description** (string|null) - Optional - Sent as `description` when not null. - **estimated_duration** (int|null) - Optional - Sent as `estimated_duration` when not null. ### Request Example ```json { "data": { "type": "events", "attributes": { "title": "Product Launch" } } } ``` ### Response #### Success Response (200) - **data** (array) - The created event resource. #### Error Response - **failure** - Returns null. ### Example ```php $event = LivestormClient::createEvent('Product Launch'); $event = LivestormClient::createEvent('Launch', slug: 'launch', description: 'Q4', estimatedDuration: 45); ``` ``` -------------------------------- ### people(?string $email = null, int $page = 1, int $perPage = 25): array Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Retrieves a paginated list of people. Optionally filters by email address. ```APIDOC ## GET {base_url}/people ### Description Retrieves a paginated list of people. Optionally filters by email address. ### Method GET ### Endpoint {base_url}/people ### Parameters #### Query Parameters - **filter[email]** (string) - Optional - Email filter. - **page[number]** (int) - Optional - Page number, default 1. - **page[size]** (int) - Optional - Number of items per page, default 25. ### Response #### Success Response (200) - **people** (list>) - List of person resources, or empty array. #### Response Example [] ``` -------------------------------- ### LivestormServiceProvider class declaration Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-service-provider.md The only integration point between the package and a Laravel host application. It extends Spatie's PackageServiceProvider and declares the package name and config file. It registers no services, bindings, routes, views, migrations, or commands. ```php name('livestorm') ->hasConfigFile(); } } ``` -------------------------------- ### POST /webhooks Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/endpoints.md Create a new webhook. The request body includes target URL and event name. ```APIDOC ## POST /webhooks ### Description Create a new webhook. ### Method POST ### Endpoint /webhooks ### Parameters #### Request Body - **data** (object) - Required - JSON:API data object. - **type** (string) - Required - Must be `webhooks`. - **attributes** (object) - Required - Webhook attributes. - **target_url** (string) - Required - The URL to send webhook events to. - **event_name** (string) - Required - The event name to subscribe to. Defaults to `attendance`. ### Request Example { "data": { "type": "webhooks", "attributes": { "target_url": "https://example.com/hook", "event_name": "attendance" } } } ### Response #### Success Response (2xx) - **data** (?array) - The created webhook object. #### Response Example {} ``` -------------------------------- ### Facade class definition (src/Facades/Livestorm.php) Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-facade.md The Livestorm facade extends Illuminate\Support\Facades\Facade and overrides getFacadeAccessor() to return the container key 'livestorm'. It has no static methods of its own; the base Facade class forwards static calls to the resolved container entry. ```php >) - List of recordings, or empty array. #### Response Example [] ``` -------------------------------- ### person(string $id): ?array Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Retrieves a single person resource by ID. Returns null if the person is not found. ```APIDOC ## GET {base_url}/people/{$id} ### Description Retrieves a single person resource by ID. ### Method GET ### Endpoint {base_url}/people/{$id} ### Parameters #### Path Parameters - **$id** (string) - Required - Person resource ID. ### Response #### Success Response (200) - **person** (array|null) - The person resource, or null on failure. #### Response Example null ``` -------------------------------- ### deleteWebhook() method signature Source: https://github.com/jeffersongoncalves/laravel-livestorm/blob/main/_autodocs/api-reference/livestorm-client.md Static method that deletes a webhook by ID via DELETE {base_url}/webhooks/{$id}. Returns true on a 2xx response, false otherwise. ```php public static function deleteWebhook(string $id): bool ```