app/Http/Controllers/NotificationTemplatesController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        $notificationTemplate = new NotificationTemplates();
        $messageTemplate  = $request->messageTemplate;
        $messageChannelRef  = $request->messageChannelRef;
        $messageStatusCode  = $request->messageStatusCode;
        $result = $notificationTemplate->addMessageTemplate($messageChannelRef, $messageStatusCode, $messageTemplate);
        if($result) {
             \Session::flash('flash_message','New message template created successfully.');
        } else {
             \Session::flash('error_message','Error in handling request.');
        }
        return redirect('notifications_templates');
    }
public function store ( Request $ request ) { $ notificationTemplate = new NotificationTemplates ( ) ; $ messageTemplate = $ request -> messageTemplate ; $ messageChannelRef = $ request -> messageChannelRef ; $ messageStatusCode = $ request -> messageStatusCode ; $ result = $ notificationTemplate -> addMessageTemplate ( $ messageChannelRef , $ messageStatusCode , $ messageTemplate ) ; if ( $ result ) { \ Session :: flash ( 'flash_message' , 'New message template created successfully.' ) ; } else { \ Session :: flash ( 'error_message' , 'Error in handling request.' ) ; } return redirect ( 'notifications_templates' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// instantiate model class // get params from post request // call function from model to add messageTemplate to database // redirect to index after save