I tried the following code, but the data was not getting saved to the DB , and no error showed up. It properly redirected to the tags.index
page and the success message also displayed, except data getting saved to DB.
But simply changing the $tags
to $tag
, it started working and the data is getting saved to DB. Can someone explain what the problem was.
public function update(CreateTagRequest $request, Tags $tags)
{
//dd($request->name);
$tags->update([
'name' => $request->name
]);
return redirect(route('tags.index'))->with('success','Tag Updated Successfully');
}
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2WD7GK9
via IFTTT
Aucun commentaire:
Enregistrer un commentaire