methodList as $i => $method) { SsConfig::insert(['name' => $method, 'type' => 1]); if ($i === 0) { SsConfig::type(1)->whereName($method)->first()->setDefault(); } } foreach ($this->protocolList as $i => $method) { SsConfig::insert(['name' => $method, 'type' => 2]); if ($i === 0) { SsConfig::type(2)->whereName($method)->first()->setDefault(); } } foreach ($this->obfsList as $i => $obs) { SsConfig::insert(['name' => $obs, 'type' => 3]); if ($i === 0) { SsConfig::type(3)->whereName($obs)->first()->setDefault(); } } } }