Code Duplication    Length = 11-11 lines in 2 locations

app/DataTables/DeviceGroupDataTable.php 1 location

@@ 19-29 (lines=11) @@
16
    {
17
        return $this->datatables
18
            ->eloquent($this->query())
19
            ->addColumn('actions', function($group) {
20
                $edit = '<button type="button" class="btn btn-xs btn-primary showModal"  data-toggle="modal" data-target="#generalModal" data-href="'.
21
                    route('device-groups.edit', ['group_id' => $group->id]).
22
                    '"><i class="fa fa-edit fa-lg fa-fw"></i><span class="hidden-xs"> '.trans('button.edit').'</span></button> ';
23
24
                $delete = '<button type="button" class="btn btn-xs btn-danger" data-toggle="modal" data-target="#deleteModal" data-href="'.
25
                    route('device-groups.destroy', ['group_id' => $group->id]).
26
                    '"><i class="fa fa-trash fa-lg fa-fw"></i><span class="hidden-xs"> '.trans('button.delete').'</span></button> ';
27
28
                return $edit.$delete;
29
            })
30
            ->make(true);
31
    }
32

app/DataTables/General/UserDataTable.php 1 location

@@ 45-55 (lines=11) @@
42
            ->editColumn('level', function($user) {
43
                return trans('user.level.'.$user->level);
44
            })
45
            ->editColumn('actions', function($user) {
46
                $edit = '<a type="button" class="btn btn-xs btn-primary" href="'.
47
                    route('users.edit', ['user_id' => $user->user_id]).
48
                    '"><i class="fa fa-edit fa-lg fa-fw"></i><span class="hidden-xs"> '.trans('button.edit').'</span></a> ';
49
50
                $delete = '<button type="button" class="btn btn-xs btn-danger userDeleteModal" data-toggle="modal" data-target="#deleteModal" data-href="'.
51
                    route('users.destroy', ['user_id' => $user->user_id]).
52
                    '"><i class="fa fa-trash fa-lg fa-fw"></i><span class="hidden-xs"> '.trans('button.delete').'</span></button> ';
53
54
                return $edit.$delete;
55
            })
56
            ->make(true);
57
    }
58