Completed
Pull Request — master (#132)
by
unknown
06:39
created

helpers.php ➔ captcha_data_url()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
if ( ! function_exists('captcha')) {
4
5
    /**
6
     * @param string $config
7
     * @return mixed
8
     */
9
    function captcha($config = 'default')
10
    {
11
        return app('captcha')->create($config);
12
    }
13
}
14
15
if ( ! function_exists('captcha_src')) {
16
    /**
17
     * @param string $config
18
     * @return string
19
     */
20
    function captcha_src($config = 'default')
21
    {
22
        return app('captcha')->src($config);
23
    }
24
}
25
26
if ( ! function_exists('captcha_img')) {
27
28
    /**
29
     * @param string $config
30
     * @return mixed
31
     */
32
    function captcha_img($config = 'default')
33
    {
34
        return app('captcha')->img($config);
35
    }
36
}
37
38
39
if ( ! function_exists('captcha_check')) {
40
    /**
41
     * @param $value
42
     * @return bool
43
     */
44
    function captcha_check($value)
45
    {
46
        return app('captcha')->check($value);
47
    }
48
}
49
50
51
if ( ! function_exists('captcha_data_url')) {
52
    /**
53
     * @param $value
54
     * @return bool
55
     */
56
    function captcha_data_url($value)
57
    {
58
        return app('captcha')->create($value)->encode('data-url')->encoded;
59
    }
60
}
61