-
Notifications
You must be signed in to change notification settings - Fork 0
/
helpers.php
72 lines (66 loc) · 1.49 KB
/
helpers.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
<?php
if (!function_exists('app_name')) {
/**
* Helper to grab the application name.
*
* @return mixed
*/
function app_name()
{
return config('app.name');
}
}
if (!function_exists('mail_styles')) {
/**
* Helper to grab the application name.
*
* @return mixed
*/
function mail_styles($variable = null)
{
$path = 'mail.transactional.' . config('general.theme');
if(!empty($variable)) {
$path .= '.' . $variable;
}
return config($path);
}
}
if (!function_exists('general_config')) {
/**
* Helper to grab the application name.
*
* @return mixed
*/
function general_config($variable = null)
{
$path = 'general.' . config('general.theme');
if(!empty($variable)) {
$path .= '.' . $variable;
}
return config($path);
}
}
if (!function_exists('generate_password')) {
/**
* Helper to generate a secure password.
*
* @param int $length
* @return string
*/
function generate_password($length = 10)
{
$random_string = str_shuffle('abcdefghjklmnopqrstuvwxyz_ABCDEFGHJKLMNOPQRSTUVWXYZ_234567890_@!$%^&!@$%^&');
return substr($random_string, 0, $length);
}
}
if (!function_exists('getDomain')) {
/**
* Helper to grab the domain name.
*
* @return mixed
*/
function getDomain()
{
return parse_url(request()->root())['host'];
}
}