mirror of
https://github.com/flarum/framework.git
synced 2025-01-20 15:46:16 +08:00
Use Routes extender
This commit is contained in:
parent
99c172b2b4
commit
4daec37f78
|
@ -10,6 +10,7 @@
|
|||
*/
|
||||
|
||||
use Flarum\Extend;
|
||||
use Flarum\Forum\Controller\FrontendController;
|
||||
use Flarum\Subscriptions\Listener;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
|
@ -19,6 +20,8 @@ return [
|
|||
->asset(__DIR__.'/js/forum/dist/extension.js')
|
||||
->asset(__DIR__.'/less/forum/extension.less')
|
||||
->bootstrapper('flarum/subscriptions/main'),
|
||||
(new Extend\Routes('forum'))
|
||||
->get('/following', 'following', FrontendController::class),
|
||||
function (Dispatcher $events, Factory $views) {
|
||||
$events->subscribe(Listener\AddDiscussionSubscriptionAttribute::class);
|
||||
$events->subscribe(Listener\FilterDiscussionListBySubscription::class);
|
||||
|
|
|
@ -13,7 +13,6 @@ namespace Flarum\Subscriptions\Listener;
|
|||
|
||||
use Flarum\Discussion\Event\Searching;
|
||||
use Flarum\Event\ConfigureDiscussionGambits;
|
||||
use Flarum\Event\ConfigureForumRoutes;
|
||||
use Flarum\Subscriptions\Gambit\SubscriptionGambit;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
|
||||
|
@ -26,7 +25,6 @@ class FilterDiscussionListBySubscription
|
|||
{
|
||||
$events->listen(ConfigureDiscussionGambits::class, [$this, 'addGambit']);
|
||||
$events->listen(Searching::class, [$this, 'filterIgnored']);
|
||||
$events->listen(ConfigureForumRoutes::class, [$this, 'addRoutes']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,12 +52,4 @@ class FilterDiscussionListBySubscription
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ConfigureForumRoutes $event
|
||||
*/
|
||||
public function addRoutes(ConfigureForumRoutes $event)
|
||||
{
|
||||
$event->get('/following', 'following');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user