app/Http/Controllers/ClientController.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)
    {
        $client = new Client();
        $clientID = $request->eclientID;
        $clientName = $request->eclientName;
        $clientCode = $request->eclientCode;
        $status = $request->eclientStatus;
        $result = $client->updateClient($clientID, $clientName, $clientCode, $status);
        if($result) {
             \Session::flash('flash_message','Client details updated successfully.');
        } else {
             \Session::flash('error_message','Error in handling request.');
        }
        return redirect('clients');
    }
public function update ( Request $ request , $ id ) { $ client = new Client ( ) ; $ clientID = $ request -> eclientID ; $ clientName = $ request -> eclientName ; $ clientCode = $ request -> eclientCode ; $ status = $ request -> eclientStatus ; $ result = $ client -> updateClient ( $ clientID , $ clientName , $ clientCode , $ status ) ; if ( $ result ) { \ Session :: flash ( 'flash_message' , 'Client details updated successfully.' ) ; } else { \ Session :: flash ( 'error_message' , 'Error in handling request.' ) ; } return redirect ( 'clients' ) ; }
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 client data // redirect to index after save