在null上调用成员函数update()

时间:2018-06-20 20:52:25

标签: laravel-5.4

这是什么错误?

  

在null上调用成员函数update()

RequisitionController.php

public function update(Request $request, SubmitApplication $submitApplication)
{
    $submitApplication = SubmitApplication::find($request['id'])->update(['approved', 1]);
    return redirect()->back();
}

SubmitApplication.php

class SubmitApplication extends Model
{
    public function school_lists()
    {
        return $this->belongsTo(SchoolsList::class);
    }

    public function requisition()
    {
        return $this->hasMany(Requisition::class);
    }
}

我想将批准的表格0更新为1。

0 个答案:

没有答案