-
Notifications
You must be signed in to change notification settings - Fork 15
/
Plugin.php
73 lines (66 loc) · 2.17 KB
/
Plugin.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php namespace Lovata\Buddies;
use App;
use Lang;
use Event;
use Illuminate\Foundation\AliasLoader;
use Lovata\Buddies\Classes\AuthHelperManager;
use Lovata\Buddies\Classes\Event\ExtendFieldHandler;
use Lovata\Buddies\Classes\Event\UserModelHandler;
use System\Classes\PluginBase;
/**
* Class Plugin
* @package Lovata\Buddies
* @author Andrey Kharanenka, a.khoronenko@lovata.com, LOVATA Group
*/
class Plugin extends PluginBase
{
/** @var array Plugin dependencies */
public $require = ['Lovata.Toolbox'];
/**
* @return array
*/
public function registerComponents()
{
return [
'\Lovata\Buddies\Components\Registration' => 'Registration',
'\Lovata\Buddies\Components\Login' => 'Login',
'\Lovata\Buddies\Components\SocialiteLogin' => 'SocialiteLogin',
'\Lovata\Buddies\Components\Logout' => 'Logout',
'\Lovata\Buddies\Components\ChangePassword' => 'ChangePassword',
'\Lovata\Buddies\Components\RestorePassword' => 'RestorePassword',
'\Lovata\Buddies\Components\ResetPassword' => 'ResetPassword',
'\Lovata\Buddies\Components\ActivationPage' => 'ActivationPage',
'\Lovata\Buddies\Components\UserPage' => 'UserPage',
'\Lovata\Buddies\Components\UserData' => 'UserData',
];
}
/**
* @return array
*/
public function registerMailTemplates()
{
return [
'lovata.buddies::mail.restore' => Lang::get('lovata.buddies::mail.restore'),
'lovata.buddies::mail.registration' => Lang::get('lovata.buddies::mail.registration'),
];
}
/**
* Register method of plugin
*/
public function register()
{
$obAlias = AliasLoader::getInstance();
$obAlias->alias('AuthHelper', 'Lovata\Buddies\Facades\AuthHelper');
App::singleton('auth.helper', function () {
return AuthHelperManager::instance();
});
}
/**
* Boot plugin method
*/
public function boot()
{
Event::subscribe(ExtendFieldHandler::class);
Event::subscribe(UserModelHandler::class);
}
}