app/Http/Controllers/AnswerController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Answer  $answer
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request,Question $question, Answer $answer)
    {
        $this->authorize('update',$answer);
        $answer->update($request->validate([
            'body' => 'required' 
        ]));
        return redirect()->route('questions.show',$question->slug)->
        with('success',' Answer Updated Successfully');
    }
public function update ( Request $ request , Question $ question , Answer $ answer ) { $ this -> authorize ( 'update' , $ answer ) ; $ answer -> update ( $ request -> validate ( [ 'body' => 'required' ] ) ) ; return redirect ( ) -> route ( 'questions.show' , $ question -> slug ) -> with ( 'success' , ' Answer Updated Successfully' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .