use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateAuditLogsTable extends Migration { public function up() { Schema::create('audit_logs', function (Blueprint $table) { $table->id(); $table->foreignId('user_id')->nullable()->constrained()->onDelete('set null'); $table->string('action'); $table->text('description')->nullable(); $table->ipAddress('ip_address')->nullable(); $table->timestamps(); }); } public function down() { Schema::dropIfExists('audit_logs'); } }