'brute_force', 'name' => 'Brute force', 'description' => 'Repeated authentication failures (SSH, web logins, SMTP AUTH).', ], [ 'slug' => 'spam', 'name' => 'Spam', 'description' => 'Unsolicited email/comment/forum spam from this source.', ], [ 'slug' => 'scanner', 'name' => 'Scanner', 'description' => 'Port/vulnerability scanning, recon traffic without follow-through exploitation.', ], [ 'slug' => 'malware_c2', 'name' => 'Malware C2', 'description' => 'Suspected command-and-control endpoint or malware distribution host.', ], [ 'slug' => 'web_attack', 'name' => 'Web attack', 'description' => 'Active web exploitation attempts: SQLi, XSS, LFI, RCE payloads.', ], ]; $existing = $this->fetchAll('SELECT slug FROM categories'); $existingSlugs = array_column($existing, 'slug'); $rows = []; foreach ($categories as $cat) { if (in_array($cat['slug'], $existingSlugs, true)) { continue; } $rows[] = [ 'slug' => $cat['slug'], 'name' => $cat['name'], 'description' => $cat['description'], 'decay_function' => 'exponential', 'decay_param' => '14.0000', 'is_active' => 1, ]; } if ($rows !== []) { $this->table('categories')->insert($rows)->save(); } } }