Code Duplication    Length = 9-9 lines in 3 locations

app/Http/Controllers/DutyController.php 1 location

@@ 20-28 (lines=9) @@
17
        return view('duty.index', compact('duties'));
18
    }
19
20
    public function create()
21
    {
22
        $this->authorize('edit');
23
24
        $users = User::active()->skipSystem()->get()->sortBy('userFullName')->pluck('userFullName', 'id');
25
        $groups = Group::all()->pluck('name', 'id');
26
27
        return view('duty.create', compact('users', 'groups'));
28
    }
29
30
    public function store(DutyRequest $request)
31
    {

app/Http/Controllers/UserController.php 2 locations

@@ 59-67 (lines=9) @@
56
        return view('user.index', compact('users', 'userStatus'));
57
    }
58
59
    public function create()
60
    {
61
        $this->authorize('edit');
62
63
        $supervisors = User::skipSystem()->active()->orderBy('last_name')->get()->pluck('userFullName', 'id')->toArray();
64
        $groups = Group::all();
65
66
        return view('user.create', compact('supervisors', 'groups'));
67
    }
68
69
    /**
70
     * @param StoreUserRequest $request
@@ 141-149 (lines=9) @@
138
            'trainings', 'activityLog', 'training_blocks', 'training_user_types'));
139
    }
140
141
    public function edit(User $user)
142
    {
143
        $this->authorize('edit');
144
145
        $supervisors = User::skipSystem()->active()->orderBy('last_name')->get()->pluck('userFullName', 'id')->toArray();
146
        $groups = Group::all();
147
148
        return view('user.edit', compact('user', 'supervisors', 'groups'));
149
    }
150
151
    public function update(UpdateUserRequest $request, User $user)
152
    {