-
Notifications
You must be signed in to change notification settings - Fork 2
/
extend.php
32 lines (23 loc) · 936 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
<?php
namespace ClarkWinkelmann\LikesReceived;
use Flarum\Api\Serializer\UserSerializer;
use Flarum\Extend;
use Flarum\Likes\Event\PostWasLiked;
use Flarum\Likes\Event\PostWasUnliked;
use Flarum\User\User;
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__ . '/resources/locale'),
(new Extend\Console())
->command(Commands\UpdateLikesReceivedCommand::class),
(new Extend\Policy)
->modelPolicy(User::class, Access\UserPolicy::class),
(new Extend\ApiSerializer(UserSerializer::class))
->attributes(Listeners\UserAttributes::class),
(new Extend\Event)
->listen(PostWasLiked::class, [Listeners\UpdateLikesCount::class, 'postWasLiked'])
->listen(PostWasUnliked::class, [Listeners\UpdateLikesCount::class, 'postWasUnliked'])
];