Beispiel #1
0
 /**
  * メールで連絡ページ
  * @Post("/mail_send/{id}", as="articles.postMailSend", where={"id": "[0-9]+"})
  * @param DirectMailPost $directMailPost
  * @param string $id
  * @return \Illuminate\Http\Response
  */
 public function postMailSend(DirectMailPost $directMailPost, $id)
 {
     $article = $this->article->find($id);
     if (empty($article)) {
         abort(404);
     }
     $data = $directMailPost->all();
     $this->articleService->directMailSend($article, $data);
     return view('article.mail_send', ['article' => $article, 'flg' => true]);
 }
Beispiel #2
0
 /**
  * 記事削除
  * @param $data
  * @throws \Exception
  */
 public function delete($data)
 {
     $article = $this->article->find($data['id']);
     if ($article) {
         if ($article->password === $data['password']) {
             $article->delete();
             Log::debug(sprintf('article delete. id: %s, password: %s', $data['id'], $data['password']));
         } else {
             Log::info(sprintf('password missing. id: %s, password: %s', $data['id'], $data['password']));
         }
     }
 }