app/Http/Controllers/NotificationTemplatesController.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)
    {
        $notificationTemplate = new NotificationTemplates();
        $template_id = $request->etemplate_id;
        $messageTemplate  = $request->emessageTemplate;
        $messageChannelRef  = $request->emessageChannelRef;
        $messageStatusCode  = $request->emessageStatusCode;
        $result =  $notificationTemplate->updateMessageTemplate($template_id, $messageChannelRef, $messageStatusCode, $messageTemplate);
        if($result) {
             \Session::flash('flash_message','Message template updated successfully.');
        } else {
             \Session::flash('error_message','Error in handling request.');
        }
        return redirect('notifications_templates');
    }
public function update ( Request $ request , $ id ) { $ notificationTemplate = new NotificationTemplates ( ) ; $ template_id = $ request -> etemplate_id ; $ messageTemplate = $ request -> emessageTemplate ; $ messageChannelRef = $ request -> emessageChannelRef ; $ messageStatusCode = $ request -> emessageStatusCode ; $ result = $ notificationTemplate -> updateMessageTemplate ( $ template_id , $ messageChannelRef , $ messageStatusCode , $ messageTemplate ) ; if ( $ result ) { \ Session :: flash ( 'flash_message' , 'Message template updated successfully.' ) ; } else { \ Session :: flash ( 'error_message' , 'Error in handling request.' ) ; } return redirect ( 'notifications_templates' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
// instantiate model class // get params from post request // call function from model to update message template data // redirect to index after save