mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 14:13:37 +08:00
Add an event to register discussion gambits
This commit is contained in:
parent
cb5baf8953
commit
347a595d7a
|
@ -13,6 +13,7 @@ use Flarum\Core\Models\User;
|
||||||
use Flarum\Core\Models\Discussion;
|
use Flarum\Core\Models\Discussion;
|
||||||
use Flarum\Core\Search\GambitManager;
|
use Flarum\Core\Search\GambitManager;
|
||||||
use League\Flysystem\Adapter\Local;
|
use League\Flysystem\Adapter\Local;
|
||||||
|
use Flarum\Core\Events\RegisterDiscussionGambits;
|
||||||
|
|
||||||
class CoreServiceProvider extends ServiceProvider
|
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\AuthorGambit');
|
||||||
$gambits->add('Flarum\Core\Search\Discussions\Gambits\UnreadGambit');
|
$gambits->add('Flarum\Core\Search\Discussions\Gambits\UnreadGambit');
|
||||||
$gambits->setFulltextGambit('Flarum\Core\Search\Discussions\Gambits\FulltextGambit');
|
$gambits->setFulltextGambit('Flarum\Core\Search\Discussions\Gambits\FulltextGambit');
|
||||||
|
|
||||||
|
event(new RegisterDiscussionGambits($gambits));
|
||||||
|
|
||||||
return $gambits;
|
return $gambits;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
13
framework/core/src/Core/Events/RegisterDiscussionGambits.php
Normal file
13
framework/core/src/Core/Events/RegisterDiscussionGambits.php
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user