uuid('id')->primary(); $table->uuid('user_id')->nullable(); $table->uuid('workspace_id'); $table->string('type'); $table->string('channel'); $table->string('title'); $table->text('body'); $table->json('data')->nullable(); $table->timestamp('read_at')->nullable(); $table->timestamp('archived_at')->nullable(); $table->timestamps(); $table->foreign('user_id')->references('id')->on('users')->nullOnDelete(); $table->foreign('workspace_id')->references('id')->on('workspaces')->cascadeOnDelete(); $table->index(['user_id', 'workspace_id', 'read_at']); }); } public function down(): void { Schema::dropIfExists('notifications'); } };