This repository was archived by the owner on Jul 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathextend.php
More file actions
38 lines (34 loc) · 1.32 KB
/
extend.php
File metadata and controls
38 lines (34 loc) · 1.32 KB
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
<?php
/**
* This file is part of reflar/reactions.
*
* Copyright (c) ReFlar.
*
* http://reflar.io
*
* For the full copyright and license information, please view the license.md
* file that was distributed with this source code.
*/
namespace Reflar\Reactions;
use Flarum\Extend;
use Illuminate\Contracts\Events\Dispatcher;
use Reflar\Reactions\Api\Controller;
return [
(new Extend\Frontend('admin'))
->css(__DIR__.'/less/admin.less')
->js(__DIR__.'/js/dist/admin.js'),
(new Extend\Frontend('forum'))
->css(__DIR__.'/less/app.less')
->js(__DIR__.'/js/dist/forum.js'),
new Extend\Locales(__DIR__.'/locale'),
(new Extend\Routes('api'))
->get('/reactions', 'reactions.index', Controller\ListReactionsController::class)
->post('/reactions', 'reactions.create', Controller\CreateReactionController::class)
->patch('/reactions/{id}', 'reactions.update', Controller\UpdateReactionController::class)
->delete('/reactions/{id}', 'reactions.delete', Controller\DeleteReactionController::class),
function (Dispatcher $events) {
$events->subscribe(Listener\AddPostReactionsRelationship::class);
$events->subscribe(Listener\SaveReactionsToDatabase::class);
$events->subscribe(Listener\SendNotificationWhenPostIsReacted::class);
},
];