Added opaque join-token support across backend and frontend: new migration/model/service/endpoints, guest controllers now resolve tokens, and the demo seeder seeds a token. Tenant event details list/manage tokens with copy/revoke actions, and the guest PWA uses tokens end-to-end (routing, storage, uploads, achievements, etc.). Docs TODO updated to reflect completed steps.

This commit is contained in:
Codex Agent
2025-10-12 10:32:37 +02:00
parent d04e234ca0
commit 9394c3171e
73 changed files with 3277 additions and 911 deletions

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('event_join_tokens', function (Blueprint $table) {
$table->id();
$table->foreignId('event_id')
->constrained()
->cascadeOnDelete();
$table->string('token', 64)->unique();
$table->string('label')->nullable();
$table->unsignedInteger('usage_limit')->nullable();
$table->unsignedInteger('usage_count')->default(0);
$table->timestamp('expires_at')->nullable();
$table->timestamp('revoked_at')->nullable();
$table->foreignId('created_by')->nullable()
->constrained('users')
->nullOnDelete();
$table->json('metadata')->nullable();
$table->timestamps();
$table->index(['event_id', 'revoked_at']);
$table->index(['revoked_at', 'expires_at']);
});
}
public function down(): void
{
Schema::dropIfExists('event_join_tokens');
}
};