@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | public function view(Association $association) { |
| 29 | - return view('association.view', ['association' => $association]); |
|
| 29 | + return view('association.view', [ 'association' => $association ]); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | public function edit(Association $association) { |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | public function home() { |
| 48 | 48 | if (!empty($this->association)) { |
| 49 | - return view('association.home', ['association' => $this->association]); |
|
| 49 | + return view('association.home', [ 'association' => $this->association ]); |
|
| 50 | 50 | } |
| 51 | 51 | else { |
| 52 | 52 | abort(404); |
@@ -54,35 +54,35 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | public function divisions(Association $association) { |
| 57 | - return view('association.divisions', ['association' => $association]); |
|
| 57 | + return view('association.divisions', [ 'association' => $association ]); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | public function teams(Association $association) { |
| 61 | - return view('association.teams', ['association' => $association]); |
|
| 61 | + return view('association.teams', [ 'association' => $association ]); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | public function venues(Association $association) { |
| 65 | - return view('association.venues', ['association' => $association]); |
|
| 65 | + return view('association.venues', [ 'association' => $association ]); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | public function series(Association $association) { |
| 69 | - return view('association.series', ['association' => $association]); |
|
| 69 | + return view('association.series', [ 'association' => $association ]); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | public function users(Association $association) { |
| 73 | - return view('association.users', ['association' => $association]); |
|
| 73 | + return view('association.users', [ 'association' => $association ]); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | public function viewUser(Association $association, User $user) { |
| 77 | - return view('association.user.view', ['association' => $association, 'user' => $user]); |
|
| 77 | + return view('association.user.view', [ 'association' => $association, 'user' => $user ]); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | public function editUser(Association $association, User $user) { |
| 81 | - return view('association.user.edit', ['association' => $association, 'user' => $user]); |
|
| 81 | + return view('association.user.edit', [ 'association' => $association, 'user' => $user ]); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | public function userToken(Association $association, User $user) { |
| 85 | - return view('association.user.token', ['association' => $association, 'user' => $user]); |
|
| 85 | + return view('association.user.token', [ 'association' => $association, 'user' => $user ]); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | public function userTokenRefresh(Association $association, User $user) { |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | 'api_token' => hash('sha256', $token), |
| 93 | 93 | ])->save(); |
| 94 | 94 | |
| 95 | - return view('association.user.token-refresh', ['association' => $association, 'user' => $user, 'token' => $token]); |
|
| 95 | + return view('association.user.token-refresh', [ 'association' => $association, 'user' => $user, 'token' => $token ]); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | public function updateUser(Request $request, Association $association, User $user) { |
@@ -112,12 +112,12 @@ discard block |
||
| 112 | 112 | return redirect($url)->with('success', 'Data saved successfully!'); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - return redirect()->route('user', ['id' => \Auth::user()->id]); |
|
| 115 | + return redirect()->route('user', [ 'id' => \Auth::user()->id ]); |
|
| 116 | 116 | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | public function addUser(Association $association) { |
| 120 | - return view('association.user.add', ['association' => $association]); |
|
| 120 | + return view('association.user.add', [ 'association' => $association ]); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | public function submitScoreBegin(Request $request) { |
@@ -129,13 +129,13 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | // get rounds with start_date < today, but greater than today - 1 week |
| 131 | 131 | $rounds = Round::whereIn('schedule_id', $schedules->pluck('id')) |
| 132 | - ->where('start_date','>=', date('Y-m-d', strtotime('-1 week'))) |
|
| 132 | + ->where('start_date', '>=', date('Y-m-d', strtotime('-1 week'))) |
|
| 133 | 133 | ->where('start_date', '<=', date('Y-m-d', strtotime("today")))->get(); |
| 134 | 134 | |
| 135 | 135 | $divisions = Division::whereIn('id', $rounds->pluck('division_id'))->get(); |
| 136 | 136 | |
| 137 | 137 | if (count($divisions) === 1) { |
| 138 | - $request->division_id = $divisions[0]->id; |
|
| 138 | + $request->division_id = $divisions[ 0 ]->id; |
|
| 139 | 139 | |
| 140 | 140 | return $this->submitScoreStep2($request); |
| 141 | 141 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $rounds = Round::whereIn('schedule_id', $schedules->pluck('id')) |
| 166 | 166 | ->where('start_date', '>=', date('Y-m-d', strtotime('-1 week'))) |
| 167 | 167 | ->where('start_date', '<=', date('Y-m-d', strtotime("today"))) |
| 168 | - ->where(function ($query) { |
|
| 168 | + ->where(function($query) { |
|
| 169 | 169 | $query->where('scores_closed', 0); |
| 170 | 170 | $query->orWhereNull('scores_closed'); |
| 171 | 171 | }) |
@@ -264,11 +264,11 @@ discard block |
||
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | public function standings() { |
| 267 | - return view('association.standings', ['association' => $this->association]); |
|
| 267 | + return view('association.standings', [ 'association' => $this->association ]); |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | public function schedule() { |
| 271 | - return view('association.schedule', ['association' => $this->association]); |
|
| 271 | + return view('association.schedule', [ 'association' => $this->association ]); |
|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | public function css() { |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | $association->save(); |
| 294 | 294 | |
| 295 | 295 | // TODO: Do not necessarily "onboard" for certain roles? |
| 296 | - return redirect()->route('onboard.association', ['association' => $association]); |
|
| 296 | + return redirect()->route('onboard.association', [ 'association' => $association ]); |
|
| 297 | 297 | } |
| 298 | 298 | else { |
| 299 | 299 | return view('denied'); |
@@ -339,13 +339,13 @@ discard block |
||
| 339 | 339 | return redirect($url)->with('success', 'Data saved successfully!'); |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | - return redirect()->route('user', ['id' => \Auth::user()->id]); |
|
| 342 | + return redirect()->route('user', [ 'id' => \Auth::user()->id ]); |
|
| 343 | 343 | |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | public function create() { |
| 347 | 347 | if (Bouncer::can('create', Association::class)) { |
| 348 | - return view('association.create', ['current_user' => \Auth::user()]); |
|
| 348 | + return view('association.create', [ 'current_user' => \Auth::user() ]); |
|
| 349 | 349 | } |
| 350 | 350 | else { |
| 351 | 351 | return view('denied'); |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | public function deleteConfirm(Association $association) { |
| 356 | - return view('association.delete', ['association' => $association]); |
|
| 356 | + return view('association.delete', [ 'association' => $association ]); |
|
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | public function delete(Association $association) { |
@@ -363,25 +363,25 @@ discard block |
||
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | public function undeleteConfirm(Association $association) { |
| 366 | - return view('association.undelete', ['association' => $association]); |
|
| 366 | + return view('association.undelete', [ 'association' => $association ]); |
|
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | public function undelete(Association $association) { |
| 370 | 370 | $association->restore(); |
| 371 | 371 | |
| 372 | - return redirect()->route('user', ['user' => \Auth::user()])->with('success', 'Association restored successfully.'); |
|
| 372 | + return redirect()->route('user', [ 'user' => \Auth::user() ])->with('success', 'Association restored successfully.'); |
|
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | public function about() { |
| 376 | - return view('association.about' , ['association' => $this->association]); |
|
| 376 | + return view('association.about', [ 'association' => $this->association ]); |
|
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | public function rules() { |
| 380 | - return view('association.rules' , ['association' => $this->association]); |
|
| 380 | + return view('association.rules', [ 'association' => $this->association ]); |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | public function contact() { |
| 384 | - return view('forms.contact', ['association' => $this->association]); |
|
| 384 | + return view('forms.contact', [ 'association' => $this->association ]); |
|
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | public function contactSubmit(Request $request) { |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | */ |
| 413 | 413 | public function contactSubmissions(Association $association) |
| 414 | 414 | { |
| 415 | - return view('association.contact_submissions', ['association' => $association]); |
|
| 415 | + return view('association.contact_submissions', [ 'association' => $association ]); |
|
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | } |
@@ -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 | } |
@@ -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'); |