app/Http/Controllers/QuestionsController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Questions  $questions
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request,$id)
    {
       $question = Questions::findOrFail($id);
       if($question){
           $question->question = $request->title;
           $question->status = $request->status;
           $question->correct_answer_id = $request->correct_answer;
           $question->save();
             return redirect('/questions/edit/'.$id)->with('success','Question updated Successfully.');
       }
    }
public function update ( Request $ request , $ id ) { $ question = Questions :: findOrFail ( $ id ) ; if ( $ question ) { $ question -> question = $ request -> title ; $ question -> status = $ request -> status ; $ question -> correct_answer_id = $ request -> correct_answer ; $ question -> save ( ) ; return redirect ( '/questions/edit/' . $ id ) -> with ( 'success' , 'Question updated Successfully.' ) ; } }
Update the specified resource in storage.
Update the specified resource in storage .