/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update($id, Requests\TemplateRequest $request) { $template = Templates::findorFail($id); $template->update($request->all()); session()->flash('flash_message', 'Template Successfully Saved!'); return redirect('templates/' . $id . ''); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // Show campaign edit for selected campaign $campaign = \App\Campaigns::findorFail($id); $lists = \App\Lists::get(); $templates = \App\Templates::take(10)->get(); return view('campaigns.edit', compact('campaign'))->with('lists', $lists)->with('templates', $templates); }