Add an event to register discussion gambits

This commit is contained in:
Toby Zerner 2015-05-02 08:12:30 +09:30
parent cb5baf8953
commit 347a595d7a
2 changed files with 17 additions and 0 deletions

View File

@ -13,6 +13,7 @@ use Flarum\Core\Models\User;
use Flarum\Core\Models\Discussion;
use Flarum\Core\Search\GambitManager;
use League\Flysystem\Adapter\Local;
use Flarum\Core\Events\RegisterDiscussionGambits;
class CoreServiceProvider extends ServiceProvider
{
@ -98,6 +99,9 @@ class CoreServiceProvider extends ServiceProvider
$gambits->add('Flarum\Core\Search\Discussions\Gambits\AuthorGambit');
$gambits->add('Flarum\Core\Search\Discussions\Gambits\UnreadGambit');
$gambits->setFulltextGambit('Flarum\Core\Search\Discussions\Gambits\FulltextGambit');
event(new RegisterDiscussionGambits($gambits));
return $gambits;
});

View File

@ -0,0 +1,13 @@
<?php namespace Flarum\Core\Events;
use Flarum\Core\Search\GambitManager;
class RegisterDiscussionGambits
{
public $gambits;
public function __construct(GambitManager $gambits)
{
$this->gambits = $gambits;
}
}