Return Meet attendees to join flow after event registration.
Deploy Ladill Events / deploy (push) Successful in 47s
Deploy Ladill Events / deploy (push) Successful in 47s
Add badge verification API, preserve meet_return through registration and payment, and link confirmation back to Meet with badge auto-login. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Http\Controllers\Controller;
|
||||
use App\Models\QrCode;
|
||||
use App\Models\User;
|
||||
use App\Services\Meet\EventMeetRoomLinkService;
|
||||
use App\Services\Meet\EventRegistrationVerifyService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -46,4 +47,24 @@ class ServiceMeetController extends Controller
|
||||
|
||||
return response()->json(['event' => $result]);
|
||||
}
|
||||
|
||||
public function verifyRegistration(Request $request, QrCode $event): JsonResponse
|
||||
{
|
||||
$validated = $request->validate([
|
||||
'owner_ref' => ['required', 'string', 'max:64'],
|
||||
'badge_code' => ['required', 'string', 'max:16'],
|
||||
]);
|
||||
|
||||
$owner = User::query()->where('public_id', $validated['owner_ref'])->firstOrFail();
|
||||
abort_unless($event->user_id === $owner->id, 403);
|
||||
abort_unless($event->type === QrCode::TYPE_EVENT, 404);
|
||||
|
||||
$result = app(EventRegistrationVerifyService::class)->verifyBadge($event, $validated['badge_code']);
|
||||
|
||||
if (! $result) {
|
||||
return response()->json(['message' => 'Badge not found.'], 404);
|
||||
}
|
||||
|
||||
return response()->json(['registration' => $result]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user