I am trying to update variables at About Us table, but i am getting this error. What is wrong?
AboutUsController:
/**
* Show the form for editing the specified resource.
*
* @param AppModelsAboutUs $aboutUs
* @return IlluminateHttpResponse
*/
public function edit($aboutUs_id)
{
$aboutUs = AboutUs::find($aboutUs_id);
return view('auth.aboutus.form',compact('aboutUs'));
}
/**
* Update the specified resource in storage.
*
* @param IlluminateHttpRequest $request
* @param AppModelsAboutUs $aboutUs
* @return IlluminateHttpResponse
*/
public function update(AboutUsRequest $request, AboutUs $aboutUs)
{
$params = $request->all();
$aboutUs->update($request->all($params));
return redirect()->route('aboutUs.index')->with('success','Post updated successfully');
}
Here is my AboutUsRequest, where i am getting this error:
public function rules()
{
$rules = [
'title1' => 'required|min:5',
'body1' => 'required|min:5',
];
if ($this->route()->named('aboutUs.update')) {
$rules['title1'] .= ',' . $this->route()->parameter('aboutUs')->id;
}
return $rules;
}
}