Passed
Pull Request — master (#1)
by
unknown
07:50
created

locales()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
/*
4
 * Check Is Mail Enabled
5
 */
6
if (! function_exists('isMailEnabled')) {
7
    function isMailEnabled(): bool
8
    {
9
        return config('mail.enabled') ?? false;
10
    }
11
}
12
13
/*
14
 * Get Available Locales
15
 */
16
if (! function_exists('locales')) {
17
    function locales()
18
    {
19
        return collect(explode(',', config('app.locales')))->reject(function ($locale) {
20
            return ! file_exists(resource_path('lang/' . $locale));
21
        });
22
    }
23
}
24
25
/*
26
 * Get gravatar image if any.
27
 */
28
if (! function_exists('gravatar')) {
29
    function gravatar($size = 36)
30
    {
31
        return 'https://www.gravatar.com/avatar/' . md5(auth()->user()->email) . '?s=' . $size;
32
    }
33
}
34
35
/*
36
 * Get authenticated user object.
37
 */
38
if (! function_exists('user')) {
39
    function user($guard = 'web')
40
    {
41
        return auth()->guard($guard)->user();
42
    }
43
}
44