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\Routing;
4
 
5
class ControllerMiddlewareOptions
6
{
7
    /**
8
     * The middleware options.
9
     *
10
     * @var array
11
     */
12
    protected $options;
13
 
14
    /**
15
     * Create a new middleware option instance.
16
     *
17
     * @param  array  $options
18
     * @return void
19
     */
20
    public function __construct(array &$options)
21
    {
22
        $this->options = &$options;
23
    }
24
 
25
    /**
26
     * Set the controller methods the middleware should apply to.
27
     *
28
     * @param  array|string|dynamic  $methods
29
     * @return $this
30
     */
31
    public function only($methods)
32
    {
33
        $this->options['only'] = is_array($methods) ? $methods : func_get_args();
34
 
35
        return $this;
36
    }
37
 
38
    /**
39
     * Set the controller methods the middleware should exclude.
40
     *
41
     * @param  array|string|dynamic  $methods
42
     * @return $this
43
     */
44
    public function except($methods)
45
    {
46
        $this->options['except'] = is_array($methods) ? $methods : func_get_args();
47
 
48
        return $this;
49
    }
50
}