@@ 40-49 (lines=10) @@ | ||
37 | return view('group.index', compact('groups')); |
|
38 | } |
|
39 | ||
40 | public function create() |
|
41 | { |
|
42 | $this->authorize('edit'); |
|
43 | ||
44 | $training = Training::orderBy('name')->get()->pluck('name', 'id')->toArray(); |
|
45 | $users = User::skipSystem()->active()->orderBy('last_name')->get()->pluck('UserFullName', 'id')->toArray(); |
|
46 | $selectedTraining = $selectedUsers = []; |
|
47 | ||
48 | return view('group.create', compact('users', 'training', 'selectedTraining', 'selectedUsers')); |
|
49 | } |
|
50 | ||
51 | /** |
|
52 | * @param GroupRequest $request |
@@ 155-164 (lines=10) @@ | ||
152 | Training::findOrFail($trainingId)->delete(); |
|
153 | } |
|
154 | ||
155 | public function assignForm($trainingID) |
|
156 | { |
|
157 | $this->authorize('edit'); |
|
158 | ||
159 | $training = Training::findOrFail($trainingID); |
|
160 | $users = User::skipSystem()->active()->orderBy('last_name')->get()->pluck('UserFullName', 'id'); |
|
161 | $groups = Group::orderBy('name')->get()->pluck('name', 'id'); |
|
162 | ||
163 | return view('training.assign_user', compact('users', 'groups', 'training')); |
|
164 | } |
|
165 | ||
166 | /** |
|
167 | * Assign our users to training. |