多个 For 循环只产生最后一次迭代而不是所有迭代的数组

问题描述

我正在尝试运行将两个值“a”和“s”相乘的代码,并使用以下等式传播它们的错误:

Error Propagation of Multiplied Values

但是,当我运行代码时,我只得到显示最后一次迭代的输出,而我需要将从每次迭代中获得的每个不确定性值放入一个长度为 10 项的数组中。我不确定如何修复我的代码以获得所有迭代输出,有没有办法做到这一点?

这是我的代码和它的图片:

public $showUserUpdationModal = false;
public $role;
public User $user;

protected $rules = [
    'user.name' => 'required|string|max:255','user.email' => 'required|string|email|max:255','role' => 'required',];

public function storeUser()
{
    $this->validate();
    $this->validate([
        'user.email' => 'unique:users,email,'.$this->user->id,]);
    $this->user->role()->associate($this->role);
    $this->user->save();
    $this->showUserUpdationModal = false;

    $this->dispatchBrowserEvent('notify',$this->user->name.' Updated Successfully');
    $this->emit('sectionRefresh');
}

Code

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...