laravel-gtm / luma-sdk
Laravel-ready PHP SDK for Luma REST APIs.
Requires
- php: ^8.4
- illuminate/support: ^11.0 || ^12.0 || ^13.0
- saloonphp/laravel-plugin: ^4.0
- saloonphp/rate-limit-plugin: ^2.0
- saloonphp/saloon: ^4.0
Requires (Dev)
- larastan/larastan: ^3.0
- orchestra/testbench: ^9.0 || ^10.0
- pestphp/pest: ^3.8
- phpstan/phpstan: ^2.1
README
Laravel-ready PHP SDK for the Luma REST API, built with Saloon.
Requirements
- PHP
^8.4 - Laravel
^11.0 || ^12.0 || ^13.0
Installation
composer require laravel-gtm/luma-sdk
The package supports Laravel auto-discovery — no manual provider registration needed.
Configuration
Publish the config file:
php artisan vendor:publish --tag=luma-config
Set your environment variables:
LUMA_BASE_URL=https://public-api.luma.com LUMA_API_TOKEN=your-token
Usage
Via the Service Container (recommended)
use LaravelGtm\LumaSdk\LumaSdk; $luma = app(LumaSdk::class);
Standalone
use LaravelGtm\LumaSdk\LumaSdk; $luma = LumaSdk::make( baseUrl: 'https://public-api.luma.com', token: 'your-token', );
Core Methods
$user = $luma->getSelf(); // Get authenticated user $entity = $luma->lookupEntity($slug); // Look up entity by slug
Laravel Boost Skills
This package includes a Laravel Boost skill to improve AI-assisted development with the SDK:
luma-sdk-development
Install the skill in your Laravel app
Laravel Boost can automatically install third-party package skills from this package.
Install Boost (if you do not already have it), then run the installer:
composer require laravel/boost --dev php artisan boost:install
When prompted, enable Skills for your agent. Boost will discover:
resources/boost/skills/luma-sdk-development/SKILL.md
If Boost is already installed in your app, run:
php artisan boost:update
Use the skill
In Cursor, ask for the luma-sdk-development skill when generating or refactoring Luma API code. The skill includes examples for:
- Events, guests, hosts, ticket types, and coupons
- Calendars, tags, people import, and lookup
- Memberships, webhooks, organizations, and images
- Value objects (
LumaDate,LumaDuration,GooglePlaceId) and pagination patterns
Resources
The SDK organizes endpoints into resource classes accessed via the main LumaSdk instance.
Events
$events = $luma->events(); // Read $event = $events->get($eventId); $guests = $events->listGuests($request); $coupons = $events->listCoupons($request); $ticketTypes = $events->listTicketTypes($eventId); $ticketType = $events->getTicketType($id); $guest = $events->getGuest(eventId: $eventId, id: $guestId); // Create & Update $events->create($request); $events->update($request); // Guests $events->addGuests($request); $events->updateGuestStatus($request); $events->sendInvites($request); // Hosts $events->createHost($request); $events->updateHost($request); $events->removeHost($eventId, $email); // Coupons $events->createCoupon($request); $events->updateCoupon($request); // Ticket Types $events->createTicketType($request); $events->updateTicketType($request); $events->deleteTicketType($ticketTypeId); // Cancellation $token = $events->requestCancellation($eventId); $events->cancel($eventId, $token->cancellationToken);
Calendars
$calendars = $luma->calendars(); // Read $calendar = $calendars->get(); $events = $calendars->listEvents(); $people = $calendars->listPeople(); $coupons = $calendars->listCoupons(); $admins = $calendars->listAdmins(); $event = $calendars->lookupEvent($request); // Events $calendars->addEvent($request); // Coupons $calendars->createCoupon($request); $calendars->updateCoupon($request); // People $calendars->importPeople($request); // Person Tags $calendars->listPersonTags(); $calendars->createPersonTag('VIP', '#ff0000'); $calendars->updatePersonTag($tagId, name: 'Speaker'); $calendars->deletePersonTag($tagId); $calendars->applyPersonTag($request); $calendars->unapplyPersonTag($request); // Event Tags $calendars->listEventTags(); $calendars->createEventTag('Workshop'); $calendars->updateEventTag($tagId, name: 'Keynote'); $calendars->deleteEventTag($tagId); $calendars->applyEventTag($tag, $eventApiIds); $calendars->unapplyEventTag($tag, $eventApiIds);
Memberships
$memberships = $luma->memberships(); $tiers = $memberships->listTiers(); $memberships->addMember($request); $memberships->updateMemberStatus($userId, 'approved');
Webhooks
$webhooks = $luma->webhooks(); $list = $webhooks->list(); $webhook = $webhooks->get($id); $webhook = $webhooks->create('https://example.com/hook', ['event.created']); $webhook = $webhooks->update($request); $webhooks->delete($id);
Organizations
$org = $luma->organizations(); $calendars = $org->listCalendars();
Images
$images = $luma->images(); $upload = $images->createUploadUrl('event-cover');
Value Objects
The SDK provides type-safe value objects for Luma-specific formats:
LumaDate
use LaravelGtm\LumaSdk\ValueObjects\LumaDate; $date = LumaDate::fromString('2026-10-04T05:20:00.000Z'); $date->toString(); // ISO 8601 UTC string $date->toTimezone('America/New_York'); // Display conversion
LumaDuration
use LaravelGtm\LumaSdk\ValueObjects\LumaDuration; $duration = LumaDuration::fromString('P1DT12H30M'); $duration->toString(); // ISO 8601 duration string $duration->toSeconds(); // Numeric representation
GooglePlaceId
use LaravelGtm\LumaSdk\ValueObjects\GooglePlaceId; $place = GooglePlaceId::fromArray(['place_id' => 'ChIJN1t_tDeuEmsRUsoyG83frY4']); $place->toArray(); // ['place_id' => '...']
Pagination
Paginated endpoints return a PaginatedResponse with cursor-based pagination:
$page = $luma->events()->listGuests($request); $page->entries; // array of response DTOs $page->hasMore; // bool $page->nextCursor; // string|null
Rate Limiting
The SDK includes built-in rate limiting via Saloon's rate-limit plugin:
- GET requests: 500 per 5 minutes
- POST requests: 100 per 5 minutes
Rate limits are handled automatically — requests will wait when limits are reached.
Testing
composer test # Run test suite composer lint # Check code style composer analyse # Static analysis (PHPStan) composer format # Fix code style
Changelog
See CHANGELOG.md for recent changes.
License
The MIT License (MIT). See LICENSE for details.