这是什么错误?
在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。