id(); $table->foreignId('user_id')->nullable()->constrained()->onDelete('set null'); $table->string('log_type'); $table->string('description'); $table->string('loggable_type')->nullable(); $table->unsignedBigInteger('loggable_id')->nullable(); $table->json('old_values')->nullable(); $table->json('new_values')->nullable(); $table->string('ip_address')->nullable(); $table->text('user_agent')->nullable(); $table->timestamps(); $table->index('user_id'); $table->index('log_type'); $table->index(['loggable_type', 'loggable_id']); $table->index('created_at'); }); } public function down(): void { Schema::dropIfExists('logs'); } };