id(); $table->string('code', 12)->unique(); $table->string('poll_token_hash', 128); $table->foreignId('user_id')->nullable()->constrained()->nullOnDelete(); $table->foreignId('personal_access_token_id')->nullable(); // Sanctum hashes tokens; the plaintext exists only at mint time. // It is stashed here for exactly one pickup by the CLI's poll, // then nulled and never persisted anywhere else. $table->string('plain_token')->nullable(); $table->timestamp('expires_at')->index(); $table->timestamp('consumed_at')->nullable(); $table->timestamps(); }); } public function down(): void { Schema::dropIfExists('device_codes'); } };