Completed
Push — master ( 7baf45...156b00 )
by Anton
01:21
created

Authorize::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 2
1
<?php
2
3
/*
4
 * This file is part of Laravel Paket.
5
 *
6
 * (c) Anton Komarev <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Cog\Laravel\Paket\Http\Middlewares;
15
16
use Closure;
17
use Illuminate\Http\Request;
18
use Symfony\Component\HttpFoundation\Response;
19
20
final class Authorize
21
{
22
    /**
23
     * Handle the incoming request.
24
     *
25
     * @param \Illuminate\Http\Request $request
26
     * @param \Closure $next
27
     * @return \Symfony\Component\HttpFoundation\Response
28
     */
29
    public function handle(Request $request, Closure $next): Response
30
    {
31
        return app()->environment('local') ? $next($request) : abort(403);
32
    }
33
}
34