public function run() { $agents = [['name' => '*', 'comment' => "All"], ['name' => 'Googlebot', 'comment' => "Google's web crawler"], ['name' => 'baiduspider', 'comment' => "Baidu's web crawler"], ['name' => 'Bingbot', 'comment' => "Microsoft's web crawler"], ['name' => 'ia_archiver', 'comment' => "The Internet Archive"], ['name' => 'Naverbot', 'comment' => "South Korean Naver web crawler"], ['name' => 'Yeti', 'comment' => "South Korean Yeti web crawler"], ['name' => 'seznambot', 'comment' => "Czech Republic Sezna web crawler"], ['name' => 'Slurp', 'comment' => "Yahoo! Slurp web crawler"], ['name' => 'Yandex', 'comment' => "Russian Yandex web crawler"]]; foreach ($agents as $agent) { Agent::updateOrCreate(['name' => $agent['name'], 'comment' => $agent['comment']]); } }
/** * Returns associative array of available agents. * * @return array */ public function getAgentOptions($fieldName = null, $keyValue = null) { return Agent::lists('comment', 'name'); }
/** * Clears all the entries from the agents model. * * @return void */ public function onClear() { Agent::truncate(); return Redirect::to('backend/mohsin/txt/agents'); }