Ejemplo n.º 1
0
 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function show($id)
 {
     //
     $commentInfo = Comment::find($id);
     if (empty($commentInfo)) {
         Notification::error('查看的评论已被删除');
         return redirect()->back();
     }
     return backendView('show', ['commentInfo' => $commentInfo]);
 }
 /**
  * Handle the event.
  *
  * @param  CommentSendEmail  $event
  * @return void
  */
 public function handle(CommentSendEmail $event)
 {
     //
     if ($event->parentId != 0) {
         $parent = Comment::find($event->parentId);
         if (!empty($parent)) {
             Mail::send('emails.comment', ['username' => $parent->username, 'id' => $parent->el_id], function ($message) use($parent) {
                 $message->to($parent->email, $parent->username)->subject('您的评论被回复了');
             });
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $comment = Comment::find($id);
     $comment->delete();
     return Redirect::to('admin/comments');
 }