@@ -39,8 +39,7 @@ discard block |
||
39 | 39 | 'venues' => Venue::orderBy('name', 'ASC')->where('association_id', $association->id)->get(), |
40 | 40 | 'current_user' => \Auth::user() |
41 | 41 | ]); |
42 | - } |
|
43 | - else { |
|
42 | + } else { |
|
44 | 43 | return view('denied'); |
45 | 44 | } |
46 | 45 | } |
@@ -48,8 +47,7 @@ discard block |
||
48 | 47 | public function home() { |
49 | 48 | if (!empty($this->association)) { |
50 | 49 | return view('association.home', ['association' => $this->association]); |
51 | - } |
|
52 | - else { |
|
50 | + } else { |
|
53 | 51 | abort(404); |
54 | 52 | } |
55 | 53 | } |
@@ -101,8 +99,7 @@ discard block |
||
101 | 99 | if (isset($request->assoc_admin)) { |
102 | 100 | Bouncer::assign('assocadmin')->to($user); |
103 | 101 | Bouncer::allow($user)->toManage($association); |
104 | - } |
|
105 | - else { |
|
102 | + } else { |
|
106 | 103 | Bouncer::disallow($user)->toManage($association); |
107 | 104 | Bouncer::retract('assocadmin')->from($user); |
108 | 105 | } |
@@ -139,15 +136,13 @@ discard block |
||
139 | 136 | $request->division_id = $divisions[0]->id; |
140 | 137 | |
141 | 138 | return $this->submitScoreStep2($request); |
142 | - } |
|
143 | - else { |
|
139 | + } else { |
|
144 | 140 | return view('forms.results.choose-division', [ |
145 | 141 | 'association' => $this->association, |
146 | 142 | 'divisions' => $divisions, |
147 | 143 | ]); |
148 | 144 | } |
149 | - } |
|
150 | - else { |
|
145 | + } else { |
|
151 | 146 | abort(404); |
152 | 147 | } |
153 | 148 | } |
@@ -177,8 +172,7 @@ discard block |
||
177 | 172 | 'association' => $this->association, |
178 | 173 | 'rounds' => $rounds, |
179 | 174 | ]); |
180 | - } |
|
181 | - else { |
|
175 | + } else { |
|
182 | 176 | abort(404); |
183 | 177 | } |
184 | 178 | } |
@@ -191,8 +185,7 @@ discard block |
||
191 | 185 | 'association' => $this->association, |
192 | 186 | 'match' => $match, |
193 | 187 | ]); |
194 | - } |
|
195 | - else { |
|
188 | + } else { |
|
196 | 189 | abort(404); |
197 | 190 | } |
198 | 191 | } |
@@ -222,20 +215,17 @@ discard block |
||
222 | 215 | return view('forms.results.thanks', [ |
223 | 216 | 'association' => $this->association, |
224 | 217 | ]); |
225 | - } |
|
226 | - else { |
|
218 | + } else { |
|
227 | 219 | return view('forms.results.choose-winner', [ |
228 | 220 | 'association' => $this->association, |
229 | 221 | 'match' => PLMatch::find($submission->match_id), |
230 | 222 | 'submission' => $submission, |
231 | 223 | ]); |
232 | 224 | } |
233 | - } |
|
234 | - else { |
|
225 | + } else { |
|
235 | 226 | abort(404); |
236 | 227 | } |
237 | - } |
|
238 | - else { |
|
228 | + } else { |
|
239 | 229 | abort(404); |
240 | 230 | } |
241 | 231 | } |
@@ -254,12 +244,10 @@ discard block |
||
254 | 244 | return view('forms.results.thanks', [ |
255 | 245 | 'association' => $this->association, |
256 | 246 | ]); |
257 | - } |
|
258 | - else { |
|
247 | + } else { |
|
259 | 248 | abort(404); |
260 | 249 | } |
261 | - } |
|
262 | - else { |
|
250 | + } else { |
|
263 | 251 | abort(404); |
264 | 252 | } |
265 | 253 | } |
@@ -295,8 +283,7 @@ discard block |
||
295 | 283 | |
296 | 284 | // TODO: Do not necessarily "onboard" for certain roles? |
297 | 285 | return redirect()->route('onboard.association', ['association' => $association]); |
298 | - } |
|
299 | - else { |
|
286 | + } else { |
|
300 | 287 | return view('denied'); |
301 | 288 | } |
302 | 289 | } |
@@ -347,8 +334,7 @@ discard block |
||
347 | 334 | public function create() { |
348 | 335 | if (Bouncer::can('create', Association::class)) { |
349 | 336 | return view('association.create', ['current_user' => \Auth::user()]); |
350 | - } |
|
351 | - else { |
|
337 | + } else { |
|
352 | 338 | return view('denied'); |
353 | 339 | } |
354 | 340 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | public function view(Association $association) { |
30 | - return view('association.view', ['association' => $association]); |
|
30 | + return view('association.view', [ 'association' => $association ]); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | public function edit(Association $association) { |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | public function home() { |
49 | 49 | if (!empty($this->association)) { |
50 | - return view('association.home', ['association' => $this->association]); |
|
50 | + return view('association.home', [ 'association' => $this->association ]); |
|
51 | 51 | } |
52 | 52 | else { |
53 | 53 | abort(404); |
@@ -55,35 +55,35 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | public function divisions(Association $association) { |
58 | - return view('association.divisions', ['association' => $association]); |
|
58 | + return view('association.divisions', [ 'association' => $association ]); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | public function teams(Association $association) { |
62 | - return view('association.teams', ['association' => $association]); |
|
62 | + return view('association.teams', [ 'association' => $association ]); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | public function venues(Association $association) { |
66 | - return view('association.venues', ['association' => $association]); |
|
66 | + return view('association.venues', [ 'association' => $association ]); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | public function series(Association $association) { |
70 | - return view('association.series', ['association' => $association]); |
|
70 | + return view('association.series', [ 'association' => $association ]); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | public function users(Association $association) { |
74 | - return view('association.users', ['association' => $association]); |
|
74 | + return view('association.users', [ 'association' => $association ]); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | public function viewUser(Association $association, User $user) { |
78 | - return view('association.user.view', ['association' => $association, 'user' => $user]); |
|
78 | + return view('association.user.view', [ 'association' => $association, 'user' => $user ]); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | public function editUser(Association $association, User $user) { |
82 | - return view('association.user.edit', ['association' => $association, 'user' => $user]); |
|
82 | + return view('association.user.edit', [ 'association' => $association, 'user' => $user ]); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | public function userToken(Association $association, User $user) { |
86 | - return view('association.user.token', ['association' => $association, 'user' => $user]); |
|
86 | + return view('association.user.token', [ 'association' => $association, 'user' => $user ]); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | public function userTokenRefresh(Association $association, User $user) { |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | 'api_token' => hash('sha256', $token), |
94 | 94 | ])->save(); |
95 | 95 | |
96 | - return view('association.user.token-refresh', ['association' => $association, 'user' => $user, 'token' => $token]); |
|
96 | + return view('association.user.token-refresh', [ 'association' => $association, 'user' => $user, 'token' => $token ]); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | public function updateUser(Request $request, Association $association, User $user) { |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | return redirect($url)->with('success', 'Data saved successfully!'); |
114 | 114 | } |
115 | 115 | |
116 | - return redirect()->route('user', ['id' => \Auth::user()->id]); |
|
116 | + return redirect()->route('user', [ 'id' => \Auth::user()->id ]); |
|
117 | 117 | |
118 | 118 | } |
119 | 119 | |
120 | 120 | public function addUser(Association $association) { |
121 | - return view('association.user.add', ['association' => $association]); |
|
121 | + return view('association.user.add', [ 'association' => $association ]); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | public function submitScoreBegin(Request $request) { |
@@ -130,13 +130,13 @@ discard block |
||
130 | 130 | |
131 | 131 | // get rounds with start_date < today, but greater than today - 1 week |
132 | 132 | $rounds = Round::whereIn('schedule_id', $schedules->pluck('id')) |
133 | - ->where('start_date','>=', date('Y-m-d', strtotime('-1 week'))) |
|
133 | + ->where('start_date', '>=', date('Y-m-d', strtotime('-1 week'))) |
|
134 | 134 | ->where('start_date', '<=', date('Y-m-d', strtotime("today")))->get(); |
135 | 135 | |
136 | 136 | $divisions = Division::whereIn('id', $rounds->pluck('division_id'))->get(); |
137 | 137 | |
138 | 138 | if (count($divisions) === 1) { |
139 | - $request->division_id = $divisions[0]->id; |
|
139 | + $request->division_id = $divisions[ 0 ]->id; |
|
140 | 140 | |
141 | 141 | return $this->submitScoreStep2($request); |
142 | 142 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $rounds = Round::whereIn('schedule_id', $schedules->pluck('id')) |
167 | 167 | ->where('start_date', '>=', date('Y-m-d', strtotime('-1 week'))) |
168 | 168 | ->where('start_date', '<=', date('Y-m-d', strtotime("today"))) |
169 | - ->where(function ($query) { |
|
169 | + ->where(function($query) { |
|
170 | 170 | $query->where('scores_closed', 0); |
171 | 171 | $query->orWhereNull('scores_closed'); |
172 | 172 | }) |
@@ -265,11 +265,11 @@ discard block |
||
265 | 265 | } |
266 | 266 | |
267 | 267 | public function standings() { |
268 | - return view('association.standings', ['association' => $this->association]); |
|
268 | + return view('association.standings', [ 'association' => $this->association ]); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | public function schedule() { |
272 | - return view('association.schedule', ['association' => $this->association]); |
|
272 | + return view('association.schedule', [ 'association' => $this->association ]); |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | public function css() { |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | $association->save(); |
295 | 295 | |
296 | 296 | // TODO: Do not necessarily "onboard" for certain roles? |
297 | - return redirect()->route('onboard.association', ['association' => $association]); |
|
297 | + return redirect()->route('onboard.association', [ 'association' => $association ]); |
|
298 | 298 | } |
299 | 299 | else { |
300 | 300 | return view('denied'); |
@@ -340,13 +340,13 @@ discard block |
||
340 | 340 | return redirect($url)->with('success', 'Data saved successfully!'); |
341 | 341 | } |
342 | 342 | |
343 | - return redirect()->route('user', ['id' => \Auth::user()->id]); |
|
343 | + return redirect()->route('user', [ 'id' => \Auth::user()->id ]); |
|
344 | 344 | |
345 | 345 | } |
346 | 346 | |
347 | 347 | public function create() { |
348 | 348 | if (Bouncer::can('create', Association::class)) { |
349 | - return view('association.create', ['current_user' => \Auth::user()]); |
|
349 | + return view('association.create', [ 'current_user' => \Auth::user() ]); |
|
350 | 350 | } |
351 | 351 | else { |
352 | 352 | return view('denied'); |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | } |
355 | 355 | |
356 | 356 | public function deleteConfirm(Association $association) { |
357 | - return view('association.delete', ['association' => $association]); |
|
357 | + return view('association.delete', [ 'association' => $association ]); |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | public function delete(Association $association) { |
@@ -364,21 +364,21 @@ discard block |
||
364 | 364 | } |
365 | 365 | |
366 | 366 | public function undeleteConfirm(Association $association) { |
367 | - return view('association.undelete', ['association' => $association]); |
|
367 | + return view('association.undelete', [ 'association' => $association ]); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | public function undelete(Association $association) { |
371 | 371 | $association->restore(); |
372 | 372 | |
373 | - return redirect()->route('user', ['user' => \Auth::user()])->with('success', 'Association restored successfully.'); |
|
373 | + return redirect()->route('user', [ 'user' => \Auth::user() ])->with('success', 'Association restored successfully.'); |
|
374 | 374 | } |
375 | 375 | |
376 | 376 | public function about() { |
377 | - return view('association.about' , ['association' => $this->association]); |
|
377 | + return view('association.about', [ 'association' => $this->association ]); |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | public function rules() { |
381 | - return view('association.rules' , ['association' => $this->association]); |
|
381 | + return view('association.rules', [ 'association' => $this->association ]); |
|
382 | 382 | } |
383 | 383 | |
384 | 384 | public function rulesDelete(Association $association) { |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | } |
394 | 394 | |
395 | 395 | public function contact() { |
396 | - return view('forms.contact', ['association' => $this->association]); |
|
396 | + return view('forms.contact', [ 'association' => $this->association ]); |
|
397 | 397 | } |
398 | 398 | |
399 | 399 | public function contactSubmit(Request $request) { |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | */ |
425 | 425 | public function contactSubmissions(Association $association) |
426 | 426 | { |
427 | - return view('association.contact_submissions', ['association' => $association]); |
|
427 | + return view('association.contact_submissions', [ 'association' => $association ]); |
|
428 | 428 | } |
429 | 429 | |
430 | 430 | } |
@@ -7,7 +7,7 @@ |
||
7 | 7 | class PLMatch extends Model |
8 | 8 | { |
9 | 9 | |
10 | - protected $fillable = array('name', 'start_date', 'end_date', 'association_id', 'series_id', 'division_id', 'schedule_id', 'round_id', 'venue_id', 'home_team_id', 'away_team_id'); |
|
10 | + protected $fillable = array('name', 'start_date', 'end_date', 'association_id', 'series_id', 'division_id', 'schedule_id', 'round_id', 'venue_id', 'home_team_id', 'away_team_id'); |
|
11 | 11 | |
12 | 12 | public function association() { |
13 | 13 | return $this->belongsTo('App\Association'); |