id(); $table->morphs('notable'); // Creates notable_type, notable_id with composite index $table->longText('content'); $table->foreignId('author_user_id')->constrained('users')->cascadeOnDelete(); $table->timestamps(); $table->index('created_at'); // For chronological sorting }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('notes'); } };