other_route()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 3
1
<?php
2
3
if (!function_exists('locale_route')) {
4
5
    /**
6
     * Generate the URL to given locale and route name.
7
     *
8
     * @param  string  $locale
9
     * @param  string  $name
10
     * @param  array   $parameters
11
     * @param  bool    $absolute
12
     * @return string
13
     */
14
    function locale_route($locale = null, $name = null, $parameters = null, $absolute = true)
15
    {
16
        return app('locale-route-url')->localeRoute($locale, $name, $parameters, $absolute);
17
    }
18
}
19
20
if (!function_exists('other_locale')) {
21
22
    /**
23
     * Generate the URL for same route name but different locale
24
     *
25
     * @param  string  $locale
26
     * @param  array   $parameters
27
     * @param  bool    $absolute
28
     * @return string
29
     */
30
    function other_locale($locale, $parameters = null, $absolute = true)
31
    {
32
        return app('locale-route-url')->otherLocale($locale, $parameters, $absolute);
33
    }
34
}
35
36
if (!function_exists('other_route')) {
37
    /**
38
     * Generate the URL for same route name but different locale
39
     *
40
     * @param  string  $name
41
     * @param  array   $parameters
42
     * @param  bool    $absolute
43
     * @return string
44
     */
45
    function other_route($name, $parameters = null, $absolute = true)
46
    {
47
        return app('locale-route-url')->otherRoute($name, $parameters, $absolute);
48
    }
49
}
50