コード例 #1
0
 /**
  * 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 . '');
 }
コード例 #2
0
 /**
  * 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);
 }