Пример #1
0
 public function update($id, ArticlesRequest $request)
 {
     $article = Article::findOrFail($id);
     $article_new = new Article($request->all());
     $article->name = $article_new->name;
     $article->description = $article_new->description;
     $article->price = $article_new->price;
     $article->reference = $article_new->reference;
     $article->brand_id = $article_new->brand_id;
     $article->model_id = $article_new->model_id;
     $article->public = $article_new->public;
     $this->saveArticle($article);
     flash()->success('Article has been updated.');
     return redirect('articles');
 }
 public function update($id, ArticlesRequest $request)
 {
     $article = Article::findOrFail($id);
     $article->update($request->all());
     return redirect('articles');
 }