-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathSharpLegacyConfigBuilder.php
More file actions
50 lines (39 loc) · 1.42 KB
/
SharpLegacyConfigBuilder.php
File metadata and controls
50 lines (39 loc) · 1.42 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
39
40
41
42
43
44
45
46
47
48
49
50
<?php
namespace Code16\Sharp\Config;
class SharpLegacyConfigBuilder extends SharpConfigBuilder
{
public function get(string $key): mixed
{
if ($key == 'entity_resolver') {
return is_string(config('sharp.entities'))
? config('sharp.entities')
: null;
}
if ($key == 'theme.logo_url') {
return config('sharp.theme.logo_url', config('sharp.theme.logo_urls.menu'));
}
if ($key == 'auth.impersonate.handler') {
return value(config('sharp.auth.impersonate.handler'));
}
if ($key == 'auth.forgotten_password.password_broker') {
return value(config('sharp.auth.forgotten_password.password_broker'));
}
if ($key == 'auth.2fa.handler') {
if (in_array(config('sharp.auth.2fa.handler'), ['notification', 'totp'])) {
return app(config('sharp.auth.2fa.handler'));
}
return value(config('sharp.auth.2fa.handler'));
}
if ($key == 'auth.message_blade_path') {
$blade = config('sharp.auth.message_blade_path');
if ($blade && view()->exists($blade)) {
return view($blade)->render();
}
return null;
}
if ($key == 'breadcrumb.display') {
return config('sharp.display_breadcrumb', true);
}
return config('sharp.'.$key);
}
}