1 | <?php |
||
12 | class AuthMiddleware implements MiddlewareInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var Messages |
||
16 | */ |
||
17 | protected $flash; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $role; |
||
23 | |||
24 | /** |
||
25 | * @var Router |
||
26 | */ |
||
27 | protected $router; |
||
28 | |||
29 | /** |
||
30 | * @var Sentinel |
||
31 | */ |
||
32 | protected $sentinel; |
||
33 | |||
34 | public function __construct(Router $router, Messages $flash, Sentinel $sentinel, $role = null) |
||
35 | { |
||
36 | $this->router = $router; |
||
37 | $this->flash = $flash; |
||
38 | $this->sentinel = $sentinel; |
||
39 | $this->role = $role; |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | public function __invoke(Request $request, Response $response, callable $next) |
||
57 | } |
||
58 |