Subversion-Projekte lars-tiefland.laravel_shop

Revision

Zur aktuellen 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
use Illuminate\Foundation\Vite;
6
 
7
trait CompilesHelpers
8
{
9
    /**
10
     * Compile the CSRF statements into valid PHP.
11
     *
12
     * @return string
13
     */
14
    protected function compileCsrf()
15
    {
16
        return '<?php echo csrf_field(); ?>';
17
    }
18
 
19
    /**
20
     * Compile the "dd" statements into valid PHP.
21
     *
22
     * @param  string  $arguments
23
     * @return string
24
     */
25
    protected function compileDd($arguments)
26
    {
27
        return "<?php dd{$arguments}; ?>";
28
    }
29
 
30
    /**
31
     * Compile the "dump" statements into valid PHP.
32
     *
33
     * @param  string  $arguments
34
     * @return string
35
     */
36
    protected function compileDump($arguments)
37
    {
38
        return "<?php dump{$arguments}; ?>";
39
    }
40
 
41
    /**
42
     * Compile the method statements into valid PHP.
43
     *
44
     * @param  string  $method
45
     * @return string
46
     */
47
    protected function compileMethod($method)
48
    {
49
        return "<?php echo method_field{$method}; ?>";
50
    }
51
 
52
    /**
53
     * Compile the "vite" statements into valid PHP.
54
     *
55
     * @param  ?string  $arguments
56
     * @return string
57
     */
58
    protected function compileVite($arguments)
59
    {
60
        $arguments ??= '()';
61
 
62
        $class = Vite::class;
63
 
64
        return "<?php echo app('$class'){$arguments}; ?>";
65
    }
66
 
67
    /**
68
     * Compile the "viteReactRefresh" statements into valid PHP.
69
     *
70
     * @return string
71
     */
72
    protected function compileViteReactRefresh()
73
    {
74
        $class = Vite::class;
75
 
76
        return "<?php echo app('$class')->reactRefresh(); ?>";
77
    }
78
}