laravel - update function is not working -
i trying update database user code , not working . there no change way!
public function update( request $request) { $request->user()->tasks()->where('id', '=', $request->id)->update([ 'name' => $request->title, 'body' => $request->body, ]); return redirect('/request'); }
try code , update database: app\user::find($request->id)->tasks()->update([ 'name' => $request->title, 'body' => $request->body ]); return redirect('/request');