Code Duplication    Length = 23-23 lines in 2 locations

app/Containers/Authorization/UI/API/Requests/CreatePermissionRequest.php 1 location

@@ 12-34 (lines=23) @@
9
 *
10
 * @author Mahmoud Zalt <[email protected]>
11
 */
12
class CreatePermissionRequest extends Request
13
{
14
15
    /**
16
     * @return  array
17
     */
18
    public function rules()
19
    {
20
        return [
21
            'name'         => 'required|unique:permissions,name|max:100',
22
            'description'  => 'max:255',
23
            'display_name' => 'max:100',
24
        ];
25
    }
26
27
    /**
28
     * @return  bool
29
     */
30
    public function authorize()
31
    {
32
        return $this->user()->hasPermissionTo('manage-roles-permissions');
33
    }
34
}
35

app/Containers/Authorization/UI/API/Requests/CreateRoleRequest.php 1 location

@@ 12-34 (lines=23) @@
9
 *
10
 * @author Mahmoud Zalt <[email protected]>
11
 */
12
class CreateRoleRequest extends Request
13
{
14
15
    /**
16
     * @return  array
17
     */
18
    public function rules()
19
    {
20
        return [
21
            'name'         => 'required|unique:roles,name|max:100',
22
            'description'  => 'max:255',
23
            'display_name' => 'max:100',
24
        ];
25
    }
26
27
    /**
28
     * @return  bool
29
     */
30
    public function authorize()
31
    {
32
        return $this->user()->hasPermissionTo('manage-roles-permissions');
33
    }
34
}
35