示例#1
0
 /**
  * Request rework value, returns true if rework value is not set.
  * @param $articleID
  * @return bool True if rework value is not set.
  */
 public function setReworkValue($articleID, $value)
 {
     Log::debug("articleID: {$articleID}, value: {$value}");
     $article = $this->articleRepository->find($articleID);
     $result = $this->articleRepository->update($article, ['rework' => $value]);
     return $result;
 }
 /**
  * Apply the updates to our resource
  */
 public function update($id, ArticleRequest $request)
 {
     // if guest or cannot article.edit, redirect -> home
     if (Entrust::can('article.edit') == false) {
         return redirect()->route('home');
     }
     // using an implementation of the Article Repository Interface
     $this->articleRepository->update($id, $request->all());
     return redirect()->route('article.index');
 }