I am trying to update the category name and I found something like this...
public function update(Request $request, Category $category)
{
$this->validate($request,[
'name' => 'required|min:3|max:50'
]);
$category->update($request->all());
return redirect()->route('cats.index', $category->id)->withMessage('Edited successfuly!');
}
Which is, I find wrong in my case. I found this on a tutorial and tried to make it for my project updating the category name... I do not understand $category->update($request->all());
Can you please explain what $category->update($request->all()); means?
And what shout I use in place of this to update the category name?
Currently, I do not see the changes. Please make it work for me.
make sure you pass the correct category id into the update route
$request->all() means all the fields passed in the request. It requires a most basic understanding of Laravel and probably indicates you need to watch some of Jeffrey's videos.