1 | <?php namespace Arcanedev\LaravelDisqus\Http\Middleware; |
||
12 | class DisqusMiddleware |
||
13 | { |
||
14 | /* ------------------------------------------------------------------------------------------------ |
||
15 | | Properties |
||
16 | | ------------------------------------------------------------------------------------------------ |
||
17 | */ |
||
18 | /** |
||
19 | * The Disqus instance. |
||
20 | * |
||
21 | * @var \Arcanedev\LaravelDisqus\Contracts\Disqus |
||
22 | */ |
||
23 | protected $disqus; |
||
24 | |||
25 | /* ------------------------------------------------------------------------------------------------ |
||
26 | | Constructor |
||
27 | | ------------------------------------------------------------------------------------------------ |
||
28 | */ |
||
29 | /** |
||
30 | * DisqusMiddleware constructor. |
||
31 | * |
||
32 | * @param \Arcanedev\LaravelDisqus\Contracts\Disqus $disqus |
||
33 | */ |
||
34 | 12 | public function __construct(Disqus $disqus) |
|
38 | |||
39 | /* ------------------------------------------------------------------------------------------------ |
||
40 | | Main Functions |
||
41 | | ------------------------------------------------------------------------------------------------ |
||
42 | */ |
||
43 | /** |
||
44 | * Handle an incoming request. |
||
45 | * |
||
46 | * @param \Illuminate\Http\Request $request |
||
47 | * @param \Closure $next |
||
48 | * |
||
49 | * @return mixed |
||
50 | */ |
||
51 | 12 | public function handle($request, Closure $next) |
|
58 | |||
59 | /* ------------------------------------------------------------------------------------------------ |
||
60 | | Other Functions |
||
61 | | ------------------------------------------------------------------------------------------------ |
||
62 | */ |
||
63 | /** |
||
64 | * Handle Disqus. |
||
65 | * |
||
66 | * @param \Illuminate\Http\Request $request |
||
67 | */ |
||
68 | 12 | protected function handleDisqus($request) |
|
73 | |||
74 | /** |
||
75 | * Get the page id. |
||
76 | * |
||
77 | * @param \Illuminate\Http\Request $request |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | 12 | protected function getPageId($request) |
|
87 | } |
||
88 |