Route webinar and conference registration through Ladill Events.
Deploy Ladill Meet / deploy (push) Successful in 1m26s
Deploy Ladill Meet / deploy (push) Successful in 1m26s
Add Events linking UI and service client, remove Meet-native registration and invitation flows for these room types, and redirect attendees to Events registration when joining. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,21 +6,97 @@ use App\Models\Room;
|
||||
|
||||
class EventsSourceLink
|
||||
{
|
||||
public static function eventAdminUrl(Room $room): ?string
|
||||
public static function isLinked(Room $room): bool
|
||||
{
|
||||
$source = (array) ($room->source ?? []);
|
||||
|
||||
if (($source['app'] ?? '') !== 'events') {
|
||||
return ($source['app'] ?? '') === 'events' && (int) ($source['event_id'] ?? 0) > 0;
|
||||
}
|
||||
|
||||
public static function eventId(Room $room): ?int
|
||||
{
|
||||
if (! self::isLinked($room)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$eventId = (int) ($source['event_id'] ?? 0);
|
||||
if ($eventId <= 0) {
|
||||
return (int) ((array) ($room->source ?? []))['event_id'];
|
||||
}
|
||||
|
||||
public static function baseUrl(): string
|
||||
{
|
||||
return rtrim((string) config('meet.events_app_url', 'https://events.ladill.com'), '/');
|
||||
}
|
||||
|
||||
public static function eventAdminUrl(Room $room): ?string
|
||||
{
|
||||
$eventId = self::eventId($room);
|
||||
|
||||
return $eventId ? self::baseUrl().'/events/'.$eventId.'/attendees' : null;
|
||||
}
|
||||
|
||||
public static function eventEditUrl(Room $room): ?string
|
||||
{
|
||||
$eventId = self::eventId($room);
|
||||
|
||||
return $eventId ? self::baseUrl().'/events/'.$eventId : null;
|
||||
}
|
||||
|
||||
public static function eventRegistrationUrl(Room $room): ?string
|
||||
{
|
||||
$source = (array) ($room->source ?? []);
|
||||
$stored = trim((string) ($source['registration_url'] ?? ''));
|
||||
|
||||
if ($stored !== '') {
|
||||
return $stored;
|
||||
}
|
||||
|
||||
$eventId = self::eventId($room);
|
||||
|
||||
return $eventId ? self::baseUrl().'/q/'.($source['short_code'] ?? '') : null;
|
||||
}
|
||||
|
||||
public static function eventQrUrl(Room $room): ?string
|
||||
{
|
||||
$eventId = self::eventId($room);
|
||||
|
||||
return $eventId ? self::baseUrl().'/events/'.$eventId.'/download/png' : null;
|
||||
}
|
||||
|
||||
public static function eventCommsUrl(Room $room): ?string
|
||||
{
|
||||
$eventId = self::eventId($room);
|
||||
|
||||
return $eventId ? self::baseUrl().'/events/'.$eventId.'/attendees/comms-preview' : null;
|
||||
}
|
||||
|
||||
public static function eventBadgesUrl(Room $room): ?string
|
||||
{
|
||||
$eventId = self::eventId($room);
|
||||
|
||||
return $eventId ? self::baseUrl().'/events/'.$eventId.'/badges' : null;
|
||||
}
|
||||
|
||||
/** @return array<string, string|null> */
|
||||
public static function urls(Room $room): array
|
||||
{
|
||||
return [
|
||||
'admin' => self::eventAdminUrl($room),
|
||||
'edit' => self::eventEditUrl($room),
|
||||
'registration' => self::eventRegistrationUrl($room),
|
||||
'qr' => self::eventQrUrl($room),
|
||||
'comms' => self::eventCommsUrl($room),
|
||||
'badges' => self::eventBadgesUrl($room),
|
||||
];
|
||||
}
|
||||
|
||||
public static function eventTitle(Room $room): ?string
|
||||
{
|
||||
if (! self::isLinked($room)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$base = rtrim((string) config('meet.events_app_url', 'https://events.ladill.com'), '/');
|
||||
$title = trim((string) (((array) ($room->source ?? []))['event_title'] ?? ''));
|
||||
|
||||
return $base.'/events/'.$eventId.'/attendees';
|
||||
return $title !== '' ? $title : null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user