'Weekly'], ['name' => 'Two weeks'], ['name' => 'Four weeks'], ['name' => 'Monthly'], ['name' => 'Two months'], ['name' => 'Three months'], ['name' => 'Four months'], ['name' => 'Six months'], ['name' => 'Annually'], ]; foreach ($frequencies as $frequency) { $record = Frequency::whereName($frequency['name'])->first(); if ($record) { //$record->save(); } else { Frequency::create($frequency); } } } }