'ollas']); $barrios = GrupoDeCompra::all(); foreach ($barrios as $barrio) { $barrio->users()->firstOrCreate([ 'name' => $barrio->nombre . '_ollas', 'password' => Hash::make('123'), 'role_id' => $ollasRol->id ]); } } /** * Reverse the migrations. * * @return void */ public function down() { $ollasRol = UserRole::where('nombre', 'ollas')->firstOrFail(); User::where('role_id', $ollasRol->id)->delete(); $ollasRol->delete(); } }