Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38482a4
commit c928314
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
app/Plugins/Comment/src/Handler/Middleware/Create/Topic/EndMiddleware.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file is part of zhuchunshu. | ||
* @link https://github.com/zhuchunshu | ||
* @document https://github.com/zhuchunshu/SForum | ||
* @contact laravel@88.com | ||
* @license https://github.com/zhuchunshu/SForum/blob/master/LICENSE | ||
*/ | ||
namespace App\Plugins\Comment\src\Handler\Middleware\Create\Topic; | ||
|
||
use App\Plugins\Topic\src\Handler\Topic\Middleware\MiddlewareInterface; | ||
|
||
class EndMiddleware implements MiddlewareInterface | ||
{ | ||
public function handler($data, \Closure $next) | ||
{ | ||
// 评论发表成功 | ||
// 添加发表成功事件 | ||
EventDispatcher()->dispatch(new \App\Plugins\User\src\Event\Task\Daily\CreateTopicComment($data['comment']['id'])); | ||
|
||
return redirect()->url('/' . $data['topic_id'] . '.html/' . $data['comment']['id'] . '?page=' . get_topic_comment_page($data['comment']['id']) . '&clean_topic_comment_content_cache=create_topic_comment_' . $data['topic_id'])->with('success', '发表成功!')->go(); | ||
} | ||
} |