authNames as $name){ if(!Authority::where('name',$name)->first())(new Authority(['name'=>$name,'alias_name'=>$name]))->save(); } } /** * Reverse the migrations. * * @return void */ public function down() { foreach ($this->authNames as $name){ Authority::where('name',$name)->delete(); } } }