-
Notifications
You must be signed in to change notification settings - Fork 2
/
extend.php
28 lines (21 loc) · 1.15 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
<?php
namespace ClarkWinkelmann\GroupInvitation;
use Flarum\Extend;
return [
(new Extend\Frontend('forum'))
->js(__DIR__ . '/js/dist/forum.js')
->css(__DIR__ . '/resources/less/forum.less')
->route('/get-role/{code:[a-zA-Z0-9_-]+}', 'group-invitation.get'),
(new Extend\Frontend('admin'))
->js(__DIR__ . '/js/dist/admin.js')
->css(__DIR__ . '/resources/less/admin.less'),
new Extend\Locales(__DIR__ . '/resources/locale'),
(new Extend\Routes('api'))
->get('/group-invitations', 'group-invitation.index', Controllers\IndexController::class)
->post('/group-invitations', 'group-invitation.store', Controllers\StoreController::class)
->get('/group-invitations/{code:[a-zA-Z0-9_-]+}', 'group-invitation.show', Controllers\ShowController::class)
->post('/group-invitations/{code:[a-zA-Z0-9_-]+}/apply', 'group-invitation.apply', Controllers\ApplyController::class)
->delete('/group-invitations/{id:[0-9]+}', 'group-invitation.delete', Controllers\DeleteController::class),
(new Extend\Policy())
->modelPolicy(Invitation::class, Access\InvitationPolicy::class),
];