-
Notifications
You must be signed in to change notification settings - Fork 3
/
extend.php
41 lines (34 loc) · 1.42 KB
/
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
38
39
40
41
<?php
/*
* This file is part of mattoid/flarum-ext-money-history.
*
* Copyright (c) 2023 mattoid.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
use Flarum\Extend;
use Flarum\Api\Serializer\BasicUserSerializer;
use Mattoid\MoneyHistory\Api\Controller\ListUserMoneyHistoryController;
use Mattoid\MoneyHistory\Attributes\UserAttributes;
use Mattoid\MoneyHistory\Event\MoneyAllHistoryEvent;
use Mattoid\MoneyHistory\Listeners\MoneyAllHistoryListeners;
use Mattoid\MoneyHistory\Listeners\MoneyHistoryListeners;
use Mattoid\MoneyHistory\Event\MoneyHistoryEvent;
return [
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__.'/less/forum.less')
->route('/u/{username}/money/history', 'mattoid-money-history.forum.nav'),
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js')
->css(__DIR__.'/less/admin.less'),
new Extend\Locales(__DIR__.'/locale'),
(new Extend\ApiSerializer(BasicUserSerializer::class))
->attributes(UserAttributes::class),
(new Extend\Routes('api'))
->get('/users/{id}/money/history', 'user.money.history', ListUserMoneyHistoryController::class),
(new Extend\Event())
->listen(MoneyHistoryEvent::class, MoneyHistoryListeners::class)
->listen(MoneyAllHistoryEvent::class, MoneyAllHistoryListeners::class),
];