id(); $table->foreignId('user_id')->constrained()->onDelete('cascade'); $table->morphs('likeable'); $table->timestamps(); $table->unique(['user_id', 'likeable_id', 'likeable_type']); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('likes'); } };