Deploy Ladill Events / deploy (push) Successful in 47s
Speakers require email, get a personal holding page with programme and stage links, auto-invites when programme hosts are saved, and manual send for events without a schedule; also fix wallet copy on event create and anchor attendee comms. Co-authored-by: Cursor <cursoragent@cursor.com>
61 lines
2.3 KiB
PHP
61 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Events;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Services\Events\EventProgrammeService;
|
|
use App\Services\Events\EventSpeakerInviteService;
|
|
use Illuminate\View\View;
|
|
|
|
class SpeakerPortalController extends Controller
|
|
{
|
|
public function __construct(
|
|
private readonly EventSpeakerInviteService $invites,
|
|
private readonly EventProgrammeService $programmes,
|
|
) {}
|
|
|
|
public function show(string $shortCode, string $token): View
|
|
{
|
|
$resolved = $this->invites->resolvePortal($shortCode, $token);
|
|
abort_unless($resolved, 404);
|
|
|
|
$event = $resolved['event'];
|
|
$speaker = $resolved['speaker'];
|
|
$content = $event->content();
|
|
$programme = null;
|
|
$programmeSnapshot = null;
|
|
|
|
$programmeId = (int) ($content['programme_qr_id'] ?? 0);
|
|
if ($programmeId > 0) {
|
|
$programme = \App\Models\QrCode::query()
|
|
->where('id', $programmeId)
|
|
->where('type', \App\Models\QrCode::TYPE_ITINERARY)
|
|
->first();
|
|
$programmeSnapshot = $this->programmes->snapshot($programme);
|
|
}
|
|
|
|
$token = (string) ($speaker['invite_token'] ?? '');
|
|
$virtualSessions = collect((array) ($content['virtual_sessions'] ?? []))
|
|
->filter(fn ($session) => is_array($session) && trim((string) ($session['join_url'] ?? '')) !== '')
|
|
->map(function (array $session) use ($event, $token) {
|
|
return [
|
|
'title' => trim((string) ($session['title'] ?? 'Virtual session')),
|
|
'type' => in_array($session['meet_room_type'] ?? '', ['webinar'], true) ? 'Webinar' : 'Conference',
|
|
'scheduled_at' => $session['scheduled_at'] ?? null,
|
|
'join_url' => $this->invites->speakerJoinUrl($event, $session, $token),
|
|
];
|
|
})
|
|
->values()
|
|
->all();
|
|
|
|
return view('events.speaker-portal', [
|
|
'event' => $event,
|
|
'speaker' => $speaker,
|
|
'eventContent' => $content,
|
|
'programmeSnapshot' => $programmeSnapshot,
|
|
'assignments' => $this->invites->assignmentsForSpeaker($event, $speaker),
|
|
'virtualSessions' => $virtualSessions,
|
|
]);
|
|
}
|
|
}
|