app/Http/Controllers/admincontroller.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, $id)
    {
        $getque=request('que');
        $getans=request('ans');
        $getop1=request('op1');
        $getop2=request('op2');
        $getop3=request('op3');
        $getop4=request('op4');
        $q=question::find($id);
        $a=answer::find($id);
        $q->question=$getque;
        $a->op1=$getop1;
        $a->op2=$getop2;
        $a->ans=$getans;
        $a->op3=$getop3;
        $a->op4=$getop4;
        $a->save();
        $q->save();
        return redirect ('/viewquestion');
    }
public function update ( Request $ request , $ id ) { $ getque = request ( 'que' ) ; $ getans = request ( 'ans' ) ; $ getop1 = request ( 'op1' ) ; $ getop2 = request ( 'op2' ) ; $ getop3 = request ( 'op3' ) ; $ getop4 = request ( 'op4' ) ; $ q = question :: find ( $ id ) ; $ a = answer :: find ( $ id ) ; $ q -> question = $ getque ; $ a -> op1 = $ getop1 ; $ a -> op2 = $ getop2 ; $ a -> ans = $ getans ; $ a -> op3 = $ getop3 ; $ a -> op4 = $ getop4 ; $ a -> save ( ) ; $ q -> save ( ) ; return redirect ( '/viewquestion' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
//echo "Successfully added"; // $pt=new pointModel();  // $a->q_id=$q->id; // $pt->choice="";