id(); $table->foreignId('user_id')->constrained('users')->cascadeOnDelete(); $table->string('title'); $table->string('category')->nullable(); $table->string('url')->nullable(); $table->string('username')->nullable(); $table->text('password'); // encrypted $table->text('notes')->nullable(); // encrypted $table->json('custom_fields')->nullable(); // encrypted $table->json('tags')->nullable(); $table->boolean('is_shared')->default(false); $table->json('shared_with')->nullable(); // user IDs $table->timestamp('expires_at')->nullable(); $table->timestamp('last_used_at')->nullable(); $table->timestamps(); $table->softDeletes(); }); Schema::create('certificates', function (Blueprint $table) { $table->id(); $table->string('name'); $table->string('domain'); $table->json('san')->nullable(); // Subject Alternative Names $table->text('certificate'); // encrypted $table->text('private_key'); // encrypted $table->text('chain')->nullable(); // encrypted $table->string('issuer')->nullable(); $table->string('type'); // self-signed, lets-encrypt, custom $table->boolean('auto_renew')->default(false); $table->timestamp('issued_at')->nullable(); $table->timestamp('expires_at'); $table->json('tags')->nullable(); $table->string('status'); // valid, expiring, expired, revoked $table->foreignId('created_by')->constrained('users'); $table->timestamps(); $table->softDeletes(); }); Schema::create('ssh_keys', function (Blueprint $table) { $table->id(); $table->foreignId('user_id')->constrained('users')->cascadeOnDelete(); $table->string('name'); $table->string('fingerprint')->unique(); $table->text('public_key'); $table->text('private_key')->nullable(); // encrypted $table->string('algorithm')->default('rsa'); $table->integer('key_size')->default(4096); $table->boolean('has_passphrase')->default(false); $table->json('tags')->nullable(); $table->timestamps(); $table->softDeletes(); }); } public function down(): void { Schema::dropIfExists('ssh_keys'); Schema::dropIfExists('certificates'); Schema::dropIfExists('password_entries'); } };