app/Http/Controllers/StatusCodesController.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)
    {
        $statusCodes = new StatusCodes();
        $estatusCodeID = $request->estatusCodeID;
        $ecode = $request->ecode;
        $edescription = $request->edescription;
        $result = $statusCodes->updateStatusCode($estatusCodeID, $ecode, $edescription);
        if($result) {
             \Session::flash('flash_message','Status code updated successfully.');
        } else {
             \Session::flash('error_message','Error in handling request.');
        }
        return redirect('status_codes');
    }
public function update ( Request $ request , $ id ) { $ statusCodes = new StatusCodes ( ) ; $ estatusCodeID = $ request -> estatusCodeID ; $ ecode = $ request -> ecode ; $ edescription = $ request -> edescription ; $ result = $ statusCodes -> updateStatusCode ( $ estatusCodeID , $ ecode , $ edescription ) ; if ( $ result ) { \ Session :: flash ( 'flash_message' , 'Status code updated successfully.' ) ; } else { \ Session :: flash ( 'error_message' , 'Error in handling request.' ) ; } return redirect ( 'status_codes' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
// instantiate model class // get params from post request ajax // call function from model to update statusCodes data // redirect to index after save