app/Http/Controllers/Admin/TutorAssignmentsController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Assignment  $assignment
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, Assignment $tutorassignment)
    {
        $tutorassignment->tutor_id = $request->tutor_val;
        $tutorassignment->student_id =$request->student_val;
        $tutorassignment->subjects = $request->subject_value;
        $tutorassignment->base_wage = $request->tpay_value;
        $tutorassignment->base_invoice = $request->spay_value;
        $tutorassignment->final_status = $request->status;
        if ($tutorassignment->save()){
            $request->session()->flash('success', 'The assignment has been updated successfully');
        } else {
            $request->session()->flash('error', 'There was an error updating the assignment');
        }
        $assignments = Assignment::all();
        $data = [
            'assignments'   => $assignments
        ];
        return redirect()->route('admin.tutorassignments.index')->with('data', $data);
    }
public function update ( Request $ request , Assignment $ tutorassignment ) { $ tutorassignment -> tutor_id = $ request -> tutor_val ; $ tutorassignment -> student_id = $ request -> student_val ; $ tutorassignment -> subjects = $ request -> subject_value ; $ tutorassignment -> base_wage = $ request -> tpay_value ; $ tutorassignment -> base_invoice = $ request -> spay_value ; $ tutorassignment -> final_status = $ request -> status ; if ( $ tutorassignment -> save ( ) ) { $ request -> session ( ) -> flash ( 'success' , 'The assignment has been updated successfully' ) ; } else { $ request -> session ( ) -> flash ( 'error' , 'There was an error updating the assignment' ) ; } $ assignments = Assignment :: all ( ) ; $ data = [ 'assignments' => $ assignments ] ; return redirect ( ) -> route ( 'admin.tutorassignments.index' ) -> with ( 'data' , $ data ) ; }
Update the specified resource in storage.
Update the specified resource in storage .