Esempio n. 1
0
 public function update(ArticleUpdateRequest $request, $id)
 {
     $article = Article::findOrFail($id);
     foreach (array_keys(array_except($this->updateFields, ['article'])) as $field) {
         $article->{$field} = $request->get($field);
     }
     $article->save();
     return redirect("/admin/article/{$id}/edit")->withSuccess("Changes saved.");
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  ArticleUpdateRequest $request
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function update(ArticleUpdateRequest $request, $id)
 {
     $article = Article::findOrFail($id);
     $article->fill($request->articleFillData());
     $article->save();
     $article->syncTags($request->get('tags', []));
     if ($request->action === 'continue') {
         return redirect()->back()->withSuccess(' article saved.');
     }
     return redirect()->route('author.article.index')->withSuccess('article <' . $article->title . '> saved.');
 }