Beispiel #1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  UpdateArticleRequest  $article
  * @return \Illuminate\Http\Response
  */
 public function update(UpdateArticleRequest $request, Article $article)
 {
     $article->update($request->except('published_at'));
     $this->syncTags($article, $request->input('tag_list'));
     if ($request->hasFile('cover')) {
         $this->uploadFile($article, $request->file('cover'));
     }
     if ($request->has('twitter')) {
         $this->tweet($article);
     }
     session()->flash('flash_message', 'Se ha actualizado tu artículo');
     return redirect('admin/articles');
 }
 public function update($id, Requests\UpdateArticleRequest $request)
 {
     $article = Article::findOrFail($id);
     $article->update($request->all());
     return redirect('/articles/' . $article->id);
 }