Completed
Push — master ( fa7b60...6c1318 )
by Mahmoud
03:02
created

GetRoleRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 21
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 6 1
A authorize() 0 4 1
1
<?php
2
3
namespace App\Containers\Authorization\UI\API\Requests;
4
5
use App\Port\Request\Abstracts\Request;
6
7
/**
8
 * Class GetRoleRequest.
9
 *
10
 * @author Mahmoud Zalt <[email protected]>
11
 */
12
class GetRoleRequest extends Request
13
{
14
15
    /**
16
     * @return  array
17
     */
18
    public function rules()
19
    {
20
        return [
21
            'name' => 'required|exists:roles,name'
22
        ];
23
    }
24
25
    /**
26
     * @return  bool
27
     */
28
    public function authorize()
29
    {
30
        return $this->user()->hasPermissionTo('manage-roles-permissions');
31
    }
32
}
33