$emails = [ "Chwern05@gmail.com", "Haehner.printing@gmail.com", "Samuel.herbst2000@gmail.com", "Samuel.herbst2005@gmail.com", "Silv.Haehner@web.de", "Smartphone.ric@gmail.com", "arthur.04@icloud.com", "ernestopetzold36@gmail.com", "flawlessreselling@gmail.com", "gw-thalheim@freenet.de", "helkejudy0@gmail.com", "jayyflawless07@gmail.com", "jayyxnyff@gmail.com", "jennyhelke07@gmail.com", "jhnocookie@gmail.com", "jj.17.10.07@gmail.com", "katrinthomschke@gmail.com", "ledinkorobin@gmail.com", "maxiholz08@gmail.com", "mw2.noah23@gmail.com", "niki71802@gmail.com", "petzernes@gmail.com", "schaarschmidtjason@gmail.com", "steffanmoose876@gmail.com", "thomschkemarco@gmail.com", "volucella.bombylans@gmail.com", "xxxblauaugexxx@googlemail.com", ]; $inserted = 0; $skipped = 0; foreach ($emails as $email) { $name = ucfirst(preg_replace('/[._\-\d]+/', ' ', explode('@', $email)[0])); $name = trim(preg_replace('/\s+/', ' ', $name)); if (empty($name)) $name = $email; $existing = \App\Models\Tester::where('email', $email)->exists(); if ($existing) { $skipped++; continue; } \App\Models\Tester::create([ 'name' => $name, 'email' => $email, 'platforms' => ['ios', 'android', 'windows'], 'is_active' => true, ]); $inserted++; } echo "Inserted: $inserted | Skipped: $skipped\n";