feat: agent token, auth.agent middleware, /mcp route with HadoServer skeleton

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BCrwHHnGCB5XH968Nxokqw
This commit is contained in:
nikita.hohlov
2026-09-05 06:03:13 -03:00
parent 9163ff97f9
commit 450c165fce
9 changed files with 248 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
<?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
{
// Токен агента (MCP): один на пользователя, строка есть — токен есть.
Schema::create('agent_tokens', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->unique()->constrained()->cascadeOnDelete();
$table->string('token_hash', 64)->unique();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('agent_tokens');
}
};