@@ -17,8 +17,7 @@ |
||
17 | 17 | { |
18 | 18 | if (\Bouncer::can('view-admin-pages')) { |
19 | 19 | return $next($request); |
20 | - } |
|
21 | - else { |
|
20 | + } else { |
|
22 | 21 | return redirect()->route('home'); |
23 | 22 | } |
24 | 23 | } |
@@ -28,8 +28,7 @@ |
||
28 | 28 | |
29 | 29 | if (Bouncer::can('manage', $association)) { |
30 | 30 | return $next($request); |
31 | - } |
|
32 | - else { |
|
31 | + } else { |
|
33 | 32 | return redirect()->route('admin'); |
34 | 33 | } |
35 | 34 | } |
@@ -31,8 +31,7 @@ discard block |
||
31 | 31 | } |
32 | 32 | |
33 | 33 | return redirect()->route('user', ['id' => \Auth::user()->id]); |
34 | - } |
|
35 | - else { |
|
34 | + } else { |
|
36 | 35 | return view('denied'); |
37 | 36 | } |
38 | 37 | } |
@@ -50,8 +49,7 @@ discard block |
||
50 | 49 | } |
51 | 50 | |
52 | 51 | return redirect()->route('user', ['id' => \Auth::user()->id]); |
53 | - } |
|
54 | - else { |
|
52 | + } else { |
|
55 | 53 | return view('denied'); |
56 | 54 | } |
57 | 55 | } |
@@ -63,8 +61,7 @@ discard block |
||
63 | 61 | public function deleteConfirm(Association $association, Team $team) { |
64 | 62 | if (Bouncer::can('delete', $team)) { |
65 | 63 | return view('team.delete', ['team' => $team]); |
66 | - } |
|
67 | - else { |
|
64 | + } else { |
|
68 | 65 | return view('denied'); |
69 | 66 | } |
70 | 67 | } |
@@ -74,8 +71,7 @@ discard block |
||
74 | 71 | $team->delete(); |
75 | 72 | |
76 | 73 | return redirect()->route('association.teams', ['association' => $association])->with('success', 'Team deleted successfully.'); |
77 | - } |
|
78 | - else { |
|
74 | + } else { |
|
79 | 75 | return view('denied'); |
80 | 76 | } |
81 | 77 | } |
@@ -31,8 +31,7 @@ discard block |
||
31 | 31 | } |
32 | 32 | |
33 | 33 | return redirect()->route('user', ['id' => \Auth::user()->id]); |
34 | - } |
|
35 | - else { |
|
34 | + } else { |
|
36 | 35 | return view('denied'); |
37 | 36 | } |
38 | 37 | } |
@@ -50,8 +49,7 @@ discard block |
||
50 | 49 | } |
51 | 50 | |
52 | 51 | return redirect()->route('user', ['id' => \Auth::user()->id]); |
53 | - } |
|
54 | - else { |
|
52 | + } else { |
|
55 | 53 | return view('denied'); |
56 | 54 | } |
57 | 55 | } |
@@ -62,8 +60,7 @@ discard block |
||
62 | 60 | 'association' => $association, |
63 | 61 | 'division' => $division, |
64 | 62 | ]); |
65 | - } |
|
66 | - else { |
|
63 | + } else { |
|
67 | 64 | return view('denied'); |
68 | 65 | } |
69 | 66 | } |
@@ -71,8 +68,7 @@ discard block |
||
71 | 68 | public function deleteConfirm(Association $association, Division $division) { |
72 | 69 | if (Bouncer::can('delete', $division)) { |
73 | 70 | return view('division.delete', ['division' => $division]); |
74 | - } |
|
75 | - else { |
|
71 | + } else { |
|
76 | 72 | return view('denied'); |
77 | 73 | } |
78 | 74 | } |
@@ -82,8 +78,7 @@ discard block |
||
82 | 78 | $division->delete(); |
83 | 79 | |
84 | 80 | return redirect()->route('association.divisions', ['association' => $association])->with('success', 'Division deleted successfully.'); |
85 | - } |
|
86 | - else { |
|
81 | + } else { |
|
87 | 82 | return view('denied'); |
88 | 83 | } |
89 | 84 | } |
@@ -37,8 +37,7 @@ discard block |
||
37 | 37 | 'venues' => Venue::orderBy('name', 'ASC')->where('association_id', $association->id)->get(), |
38 | 38 | 'current_user' => \Auth::user() |
39 | 39 | ]); |
40 | - } |
|
41 | - else { |
|
40 | + } else { |
|
42 | 41 | return view('denied'); |
43 | 42 | } |
44 | 43 | } |
@@ -46,8 +45,7 @@ discard block |
||
46 | 45 | public function home() { |
47 | 46 | if (!empty($this->association)) { |
48 | 47 | return view('association.home', ['association' => $this->association]); |
49 | - } |
|
50 | - else { |
|
48 | + } else { |
|
51 | 49 | abort(404); |
52 | 50 | } |
53 | 51 | } |
@@ -81,8 +79,7 @@ discard block |
||
81 | 79 | if (isset($request->assoc_admin)) { |
82 | 80 | Bouncer::assign('assocadmin')->to($user); |
83 | 81 | Bouncer::allow($user)->toManage($association); |
84 | - } |
|
85 | - else { |
|
82 | + } else { |
|
86 | 83 | Bouncer::disallow($user)->toManage($association); |
87 | 84 | Bouncer::retract('assocadmin')->from($user); |
88 | 85 | } |
@@ -119,15 +116,13 @@ discard block |
||
119 | 116 | $request->division_id = $divisions[0]->id; |
120 | 117 | |
121 | 118 | return $this->submitScoreStep2($request); |
122 | - } |
|
123 | - else { |
|
119 | + } else { |
|
124 | 120 | return view('forms.results.choose-division', [ |
125 | 121 | 'association' => $this->association, |
126 | 122 | 'divisions' => $divisions, |
127 | 123 | ]); |
128 | 124 | } |
129 | - } |
|
130 | - else { |
|
125 | + } else { |
|
131 | 126 | abort(404); |
132 | 127 | } |
133 | 128 | } |
@@ -153,8 +148,7 @@ discard block |
||
153 | 148 | 'association' => $this->association, |
154 | 149 | 'rounds' => $rounds, |
155 | 150 | ]); |
156 | - } |
|
157 | - else { |
|
151 | + } else { |
|
158 | 152 | abort(404); |
159 | 153 | } |
160 | 154 | } |
@@ -167,8 +161,7 @@ discard block |
||
167 | 161 | 'association' => $this->association, |
168 | 162 | 'match' => $match, |
169 | 163 | ]); |
170 | - } |
|
171 | - else { |
|
164 | + } else { |
|
172 | 165 | abort(404); |
173 | 166 | } |
174 | 167 | } |
@@ -195,12 +188,10 @@ discard block |
||
195 | 188 | return view('forms.results.thanks', [ |
196 | 189 | 'association' => $this->association, |
197 | 190 | ]); |
198 | - } |
|
199 | - else { |
|
191 | + } else { |
|
200 | 192 | abort(404); |
201 | 193 | } |
202 | - } |
|
203 | - else { |
|
194 | + } else { |
|
204 | 195 | abort(404); |
205 | 196 | } |
206 | 197 | } |
@@ -236,8 +227,7 @@ discard block |
||
236 | 227 | |
237 | 228 | // TODO: Do not necessarily "onboard" for certain roles? |
238 | 229 | return redirect()->route('onboard.association', ['association' => $association]); |
239 | - } |
|
240 | - else { |
|
230 | + } else { |
|
241 | 231 | return view('denied'); |
242 | 232 | } |
243 | 233 | } |
@@ -278,8 +268,7 @@ discard block |
||
278 | 268 | public function create() { |
279 | 269 | if (Bouncer::can('create', Association::class)) { |
280 | 270 | return view('association.create', ['current_user' => \Auth::user()]); |
281 | - } |
|
282 | - else { |
|
271 | + } else { |
|
283 | 272 | return view('denied'); |
284 | 273 | } |
285 | 274 | } |
@@ -75,8 +75,7 @@ |
||
75 | 75 | |
76 | 76 | if ($request->delete == 'delete') { |
77 | 77 | $submission->delete(); |
78 | - } |
|
79 | - else { |
|
78 | + } else { |
|
80 | 79 | $result = Result::where('match_id', $submission->match_id)->first(); |
81 | 80 | |
82 | 81 | if (empty($result)) { |
@@ -62,8 +62,7 @@ |
||
62 | 62 | |
63 | 63 | if (!empty($division)) { |
64 | 64 | $schedule->sequence = $division->sequence; |
65 | - } |
|
66 | - else { |
|
65 | + } else { |
|
67 | 66 | $schedule->sequence = null; |
68 | 67 | } |
69 | 68 |
@@ -13,8 +13,7 @@ discard block |
||
13 | 13 | public function admin() { |
14 | 14 | if (Bouncer::can('view-admin-pages')) { |
15 | 15 | return view('admin'); |
16 | - } |
|
17 | - else { |
|
16 | + } else { |
|
18 | 17 | return view('denied'); |
19 | 18 | } |
20 | 19 | } |
@@ -24,8 +23,7 @@ discard block |
||
24 | 23 | return view('admin.users', [ |
25 | 24 | 'users' => User::all(), |
26 | 25 | ]); |
27 | - } |
|
28 | - else { |
|
26 | + } else { |
|
29 | 27 | return view('denied'); |
30 | 28 | } |
31 | 29 | } |
@@ -35,8 +33,7 @@ discard block |
||
35 | 33 | $associations = Association::onlyTrashed()->get(); |
36 | 34 | |
37 | 35 | return view('admin.associations.trashed', ['associations' => $associations]); |
38 | - } |
|
39 | - else { |
|
36 | + } else { |
|
40 | 37 | return view('denied'); |
41 | 38 | } |
42 | 39 | } |
@@ -30,8 +30,7 @@ discard block |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | return redirect()->route('user', ['id' => \Auth::user()->id]); |
33 | - } |
|
34 | - else { |
|
33 | + } else { |
|
35 | 34 | return view('denied'); |
36 | 35 | } |
37 | 36 | } |
@@ -39,8 +38,7 @@ discard block |
||
39 | 38 | public function edit(Association $association, Venue $venue) { |
40 | 39 | if (Bouncer::can('edit', Venue::class)) { |
41 | 40 | return view('venue.edit', ['venue' => $venue]); |
42 | - } |
|
43 | - else { |
|
41 | + } else { |
|
44 | 42 | return view('denied'); |
45 | 43 | } |
46 | 44 | } |
@@ -58,8 +56,7 @@ discard block |
||
58 | 56 | } |
59 | 57 | |
60 | 58 | return redirect()->route('admin'); |
61 | - } |
|
62 | - else { |
|
59 | + } else { |
|
63 | 60 | return view('denied'); |
64 | 61 | } |
65 | 62 | } |
@@ -67,8 +64,7 @@ discard block |
||
67 | 64 | public function deleteConfirm(Venue $venue) { |
68 | 65 | if (Bouncer::can('delete', $venue)) { |
69 | 66 | return view('venue.delete', ['venue' => $venue]); |
70 | - } |
|
71 | - else { |
|
67 | + } else { |
|
72 | 68 | return view('denied'); |
73 | 69 | } |
74 | 70 | } |
@@ -80,8 +76,7 @@ discard block |
||
80 | 76 | $venue->delete(); |
81 | 77 | |
82 | 78 | return redirect()->route('association.venues', ['association' => $association])->with('success', 'Venue deleted successfully.'); |
83 | - } |
|
84 | - else { |
|
79 | + } else { |
|
85 | 80 | return view('denied'); |
86 | 81 | } |
87 | 82 | } |