Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\View\Compilers\Concerns;
4
 
5
trait CompilesAuthorizations
6
{
7
    /**
8
     * Compile the can statements into valid PHP.
9
     *
10
     * @param  string  $expression
11
     * @return string
12
     */
13
    protected function compileCan($expression)
14
    {
15
        return "<?php if (app(\Illuminate\\Contracts\\Auth\\Access\\Gate::class)->check{$expression}): ?>";
16
    }
17
 
18
    /**
19
     * Compile the cannot statements into valid PHP.
20
     *
21
     * @param  string  $expression
22
     * @return string
23
     */
24
    protected function compileCannot($expression)
25
    {
26
        return "<?php if (app(\Illuminate\\Contracts\\Auth\\Access\\Gate::class)->denies{$expression}): ?>";
27
    }
28
 
29
    /**
30
     * Compile the canany statements into valid PHP.
31
     *
32
     * @param  string  $expression
33
     * @return string
34
     */
35
    protected function compileCanany($expression)
36
    {
37
        return "<?php if (app(\Illuminate\\Contracts\\Auth\\Access\\Gate::class)->any{$expression}): ?>";
38
    }
39
 
40
    /**
41
     * Compile the else-can statements into valid PHP.
42
     *
43
     * @param  string  $expression
44
     * @return string
45
     */
46
    protected function compileElsecan($expression)
47
    {
48
        return "<?php elseif (app(\Illuminate\\Contracts\\Auth\\Access\\Gate::class)->check{$expression}): ?>";
49
    }
50
 
51
    /**
52
     * Compile the else-cannot statements into valid PHP.
53
     *
54
     * @param  string  $expression
55
     * @return string
56
     */
57
    protected function compileElsecannot($expression)
58
    {
59
        return "<?php elseif (app(\Illuminate\\Contracts\\Auth\\Access\\Gate::class)->denies{$expression}): ?>";
60
    }
61
 
62
    /**
63
     * Compile the else-canany statements into valid PHP.
64
     *
65
     * @param  string  $expression
66
     * @return string
67
     */
68
    protected function compileElsecanany($expression)
69
    {
70
        return "<?php elseif (app(\Illuminate\\Contracts\\Auth\\Access\\Gate::class)->any{$expression}): ?>";
71
    }
72
 
73
    /**
74
     * Compile the end-can statements into valid PHP.
75
     *
76
     * @return string
77
     */
78
    protected function compileEndcan()
79
    {
80
        return '<?php endif; ?>';
81
    }
82
 
83
    /**
84
     * Compile the end-cannot statements into valid PHP.
85
     *
86
     * @return string
87
     */
88
    protected function compileEndcannot()
89
    {
90
        return '<?php endif; ?>';
91
    }
92
 
93
    /**
94
     * Compile the end-canany statements into valid PHP.
95
     *
96
     * @return string
97
     */
98
    protected function compileEndcanany()
99
    {
100
        return '<?php endif; ?>';
101
    }
102
}