@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $trainingUser = TrainingUser::findOrFail($trainingUserID); |
63 | 63 | |
64 | 64 | //disable the due by field unless admin. |
65 | - if(Gate::denies('edit')) { |
|
65 | + if (Gate::denies('edit')) { |
|
66 | 66 | $disabled = 'disabled'; |
67 | 67 | } else { |
68 | 68 | $disabled = ''; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | public function destroy($userID, $trainingUserID) |
90 | 90 | { |
91 | 91 | TrainingUser::findOrFail($trainingUserID)->delete(); |
92 | - Storage::deleteDirectory('traininguser_'.$trainingUserID); |
|
92 | + Storage::deleteDirectory('traininguser_' . $trainingUserID); |
|
93 | 93 | |
94 | 94 | return Redirect::back(); |
95 | 95 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | { |
40 | 40 | $this->middleware('guest', ['except' => 'logout']); |
41 | 41 | |
42 | - if(config('auth.guards.web.provider') == 'adldap') { |
|
42 | + if (config('auth.guards.web.provider') == 'adldap') { |
|
43 | 43 | Adldap::connect(); |
44 | 44 | } |
45 | 45 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $this->authorize('view'); |
28 | 28 | |
29 | 29 | $users = User::with([ |
30 | - 'assignedTrainings' => function ($q) { |
|
30 | + 'assignedTrainings' => function($q) { |
|
31 | 31 | $q->whereNull('completed_date') |
32 | 32 | ->whereBetween('due_date', [Carbon::now()->subYear(), Carbon::now()->addWeeks(4)]); |
33 | 33 | }, |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $data['status'] = 'active'; |
61 | 61 | $user = User::create($data); |
62 | 62 | |
63 | - if( array_key_exists('groups', $data)) { |
|
63 | + if (array_key_exists('groups', $data)) { |
|
64 | 64 | settype($data['groups'], "array"); |
65 | 65 | $user->groups()->sync($data['groups']); |
66 | 66 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function show($userId) |
76 | 76 | { |
77 | - $user = User::with(['subordinates' => function ($query) { |
|
77 | + $user = User::with(['subordinates' => function($query) { |
|
78 | 78 | $query->active(); |
79 | 79 | }, 'supervisor', 'groups', 'duties', 'attachments']) |
80 | 80 | ->findOrFail($userId); |
@@ -91,14 +91,14 @@ discard block |
||
91 | 91 | $travels = $user->travels()->with('author', 'attachments')->get(); |
92 | 92 | |
93 | 93 | $logs = []; |
94 | - if(Gate::allows('view')) { |
|
94 | + if (Gate::allows('view')) { |
|
95 | 95 | $logs = $user->logs()->orderBy('created_at', 'desc')->get(); |
96 | 96 | } |
97 | 97 | |
98 | 98 | $this->previousAndNextUsers($user, $previous, $next); |
99 | 99 | |
100 | 100 | //This mess is just so that we can output the Security Check list or show none. Mainly just to show none. |
101 | - $duties = Duty::whereHas('users', function ($q) use ($userId){ |
|
101 | + $duties = Duty::whereHas('users', function($q) use ($userId){ |
|
102 | 102 | $q->where('id', $userId); |
103 | 103 | })->orWhereHas('groups.users', function($q) use ($userId) { |
104 | 104 | $q->where('id', $userId); |
@@ -136,14 +136,14 @@ discard block |
||
136 | 136 | $user->update($data); |
137 | 137 | |
138 | 138 | //Handle user groups |
139 | - if( !array_key_exists('groups', $data)) { |
|
139 | + if (!array_key_exists('groups', $data)) { |
|
140 | 140 | $data['groups'] = []; |
141 | 141 | } |
142 | 142 | $user->groups()->sync($data['groups']); |
143 | 143 | |
144 | 144 | //Handled closed area access (MUST come AFTER syncing groups). |
145 | - if( array_key_exists('access', $data)) { |
|
146 | - foreach($data['access'] as $group_id => $accessLevel) { |
|
145 | + if (array_key_exists('access', $data)) { |
|
146 | + foreach ($data['access'] as $group_id => $accessLevel) { |
|
147 | 147 | $user->groups()->updateExistingPivot($group_id, ['access' => $accessLevel]); |
148 | 148 | } |
149 | 149 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | */ |
159 | 159 | public function destroy($userId) |
160 | 160 | { |
161 | - Storage::deleteDirectory('user_'.$userId); |
|
161 | + Storage::deleteDirectory('user_' . $userId); |
|
162 | 162 | User::findOrFail($userId)->delete(); |
163 | 163 | |
164 | 164 | return "success"; |
@@ -60,7 +60,7 @@ |
||
60 | 60 | public function destroy($userID, $travelID) |
61 | 61 | { |
62 | 62 | Travel::findOrFail($travelID)->delete(); |
63 | - Storage::deleteDirectory('travel_'.$travelID); |
|
63 | + Storage::deleteDirectory('travel_' . $travelID); |
|
64 | 64 | |
65 | 65 | return Redirect::back(); |
66 | 66 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | $type = 'SET\\' . $data['type']; |
17 | 17 | $dutyID = intval($data['duty']); |
18 | 18 | |
19 | - ( new DutyList($dutyID) )->processSwapRequest($dates, $IDs, $type); |
|
19 | + (new DutyList($dutyID))->processSwapRequest($dates, $IDs, $type); |
|
20 | 20 | |
21 | 21 | return redirect()->action('DutyController@show', $dutyID); |
22 | 22 |
@@ -33,13 +33,13 @@ discard block |
||
33 | 33 | private function getDueTraining() |
34 | 34 | { |
35 | 35 | |
36 | - return Training::with(['users', 'assignedUsers' => function ($query) { |
|
36 | + return Training::with(['users', 'assignedUsers' => function($query) { |
|
37 | 37 | //filter the assignedusers we get back |
38 | 38 | $query->ActiveUsers() |
39 | 39 | ->whereNull('completed_date') |
40 | 40 | ->where('due_date', '<=', Carbon::now()); |
41 | 41 | }]) |
42 | - ->whereHas('assignedUsers', function ($q) { |
|
42 | + ->whereHas('assignedUsers', function($q) { |
|
43 | 43 | //filter the training we get. |
44 | 44 | $q->ActiveUsers() |
45 | 45 | ->whereNull('completed_date') |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | */ |
54 | 54 | private function getExpiringVisits() |
55 | 55 | { |
56 | - return User::with(['visits' => function ($query) { |
|
56 | + return User::with(['visits' => function($query) { |
|
57 | 57 | $query->whereBetween('expiration_date', [Carbon::now(), Carbon::now()->addWeek()]); |
58 | - }])->whereHas('visits', function ($q) { |
|
58 | + }])->whereHas('visits', function($q) { |
|
59 | 59 | $q->whereBetween('expiration_date', [Carbon::now(), Carbon::now()->addWeek()]); |
60 | 60 | })->Active()->get(); |
61 | 61 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $years = 5; |
91 | 91 | } else if ($user->access_level == 'S' || $user->clearance == 'S') { |
92 | 92 | $years = 10; |
93 | - } else if($user->clearance = 'TS') { |
|
93 | + } else if ($user->clearance = 'TS') { |
|
94 | 94 | $years = 5; |
95 | 95 | } |
96 | 96 |
@@ -32,34 +32,34 @@ |
||
32 | 32 | $this->registerPolicies($gate); |
33 | 33 | |
34 | 34 | //user can edit this. AKA, they are an admin. |
35 | - $gate->define('edit', function ($user) { |
|
35 | + $gate->define('edit', function($user) { |
|
36 | 36 | return $this->isAdmin($user); |
37 | 37 | }); |
38 | 38 | |
39 | 39 | //user has view rights |
40 | - $gate->define('view', function ($user) { |
|
40 | + $gate->define('view', function($user) { |
|
41 | 41 | return $this->isViewer($user); |
42 | 42 | }); |
43 | 43 | |
44 | 44 | //Let admin update note & user update training note. |
45 | - $gate->define('update_record', function ($user, $record) { |
|
45 | + $gate->define('update_record', function($user, $record) { |
|
46 | 46 | return ($user->id == $record->user_id || $this->isAdmin($user)); |
47 | 47 | }); |
48 | 48 | |
49 | 49 | // primarily used to set javascript variable. |
50 | - $gate->define('update_self', function ($user, $page) { |
|
50 | + $gate->define('update_self', function($user, $page) { |
|
51 | 51 | return $user->id == $page->id && !$this->isAdmin($user); |
52 | 52 | }); |
53 | 53 | |
54 | - $gate->define('show_user', function ($user, $page) { |
|
54 | + $gate->define('show_user', function($user, $page) { |
|
55 | 55 | return ($this->isViewer($user) || $user->id === $page->id); |
56 | 56 | }); |
57 | 57 | |
58 | - $gate->define('show_note', function ($user, $page) { |
|
58 | + $gate->define('show_note', function($user, $page) { |
|
59 | 59 | return ($this->isAdmin($user) || Note::findOrFail($page->id)->user()->id === $user->id); |
60 | 60 | }); |
61 | 61 | |
62 | - $gate->define('show_published_news', function ($user, $news) { |
|
62 | + $gate->define('show_published_news', function($user, $news) { |
|
63 | 63 | return ($this->isViewer($user) || |
64 | 64 | ($news->publish_date <= Carbon::today() && |
65 | 65 | ($news->expire_date >= Carbon::today() || |
@@ -19,7 +19,7 @@ |
||
19 | 19 | /* |
20 | 20 | * Authenticate the user's personal channel... |
21 | 21 | */ |
22 | - Broadcast::channel('App.User.*', function ($user, $userId) { |
|
22 | + Broadcast::channel('App.User.*', function($user, $userId) { |
|
23 | 23 | return (int) $user->id === (int) $userId; |
24 | 24 | }); |
25 | 25 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | Route::group([ |
46 | 46 | 'middleware' => 'web', |
47 | 47 | 'namespace' => $this->namespace, |
48 | - ], function ($router) { |
|
48 | + ], function($router) { |
|
49 | 49 | require base_path('routes/web.php'); |
50 | 50 | }); |
51 | 51 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | 'middleware' => 'api', |
63 | 63 | 'namespace' => $this->namespace, |
64 | 64 | 'prefix' => 'api', |
65 | - ], function ($router) { |
|
65 | + ], function($router) { |
|
66 | 66 | require base_path('routes/api.php'); |
67 | 67 | }); |
68 | 68 | } |