Passed
Push — master ( 33cc86...c17e3f )
by Iman
04:11
created

PrivilegeRepo::deleteByRoleId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace crocodicstudio\crudbooster\Modules\PrivilegeModule;
4
5
class PrivilegeRepo
6
{
7
    public static function deleteByRoleId($id)
8
    {
9
        return \DB::table('cms_privileges_roles')->where('cms_privileges_id', $id)->delete();
10
    }
11
12
    /**
13
     * @param $id
14
     */
15
    public function grantAllPermissions($id)
16
    {
17
        \DB::table('cms_privileges_roles')->insert([
18
            'cms_modules_id' => $id,
19
            'cms_privileges_id' => cbUser()->cms_privileges_id,
0 ignored issues
show
Bug introduced by
Accessing cms_privileges_id on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
20
            'can_see_module' => 1,
21
            'can_create' => 1,
22
            'can_read' => 1,
23
            'can_edit' => 1,
24
            'can_delete' => 1,
25
        ]);
26
    }
27
}