UserCanManageBlogPosts   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
dl 0
loc 11
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 1
1
<?php
2
3
namespace WebDevEtc\BlogEtc\Middleware;
4
5
use Closure;
6
use WebDevEtc\BlogEtc\Helpers;
7
8
class UserCanManageBlogPosts
9
{
10
    public function handle($request, Closure $next)
11
    {
12
        abort_if(
13
            !Helpers::hasAdminGateAccess(),
14
            401,
15
            'User not authorised to manage blog posts'
16
        );
17
18
        return $next($request);
19
    }
20
}
21