-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
extend.php
37 lines (29 loc) · 978 Bytes
/
extend.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Flarum\Akismet\Listener;
use Flarum\Akismet\Provider\AkismetProvider;
use Flarum\Approval\Event\PostWasApproved;
use Flarum\Extend;
use Flarum\Post\Event\Hidden;
use Flarum\Post\Event\Saving;
use Flarum\Post\Post;
return [
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js'),
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js'),
new Extend\Locales(__DIR__.'/locale'),
(new Extend\Event())
->listen(Hidden::class, Listener\SubmitSpam::class)
->listen(PostWasApproved::class, Listener\SubmitHam::class)
->listen(Saving::class, Listener\ValidatePost::class),
(new Extend\ServiceProvider())
->register(AkismetProvider::class),
(new Extend\Model(Post::class))
->cast('is_spam', 'bool'),
];