Completed
Push — master ( c5ca0a...8dff3f )
by Sam
04:55
created
app/Http/Controllers/AssociationsController.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     }
26 26
 
27 27
     public function view(Association $association) {
28
-        return view('association.view', ['association' => $association]);
28
+        return view('association.view', [ 'association' => $association ]);
29 29
     }
30 30
 
31 31
     public function edit(Association $association) {
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
     public function home() {
47 47
         if (!empty($this->association)) {
48
-            return view('association.home', ['association' => $this->association]);
48
+            return view('association.home', [ 'association' => $this->association ]);
49 49
         }
50 50
         else {
51 51
             abort(404);
@@ -53,27 +53,27 @@  discard block
 block discarded – undo
53 53
     }
54 54
 
55 55
     public function divisions(Association $association) {
56
-        return view('association.divisions', ['association' => $association]);
56
+        return view('association.divisions', [ 'association' => $association ]);
57 57
     }
58 58
 
59 59
     public function teams(Association $association) {
60
-        return view('association.teams', ['association' => $association]);
60
+        return view('association.teams', [ 'association' => $association ]);
61 61
     }
62 62
 
63 63
     public function venues(Association $association) {
64
-        return view('association.venues', ['association' => $association]);
64
+        return view('association.venues', [ 'association' => $association ]);
65 65
     }
66 66
 
67 67
     public function series(Association $association) {
68
-        return view('association.series', ['association' => $association]);
68
+        return view('association.series', [ 'association' => $association ]);
69 69
     }
70 70
 
71 71
     public function users(Association $association) {
72
-        return view('association.users', ['association' => $association]);
72
+        return view('association.users', [ 'association' => $association ]);
73 73
     }
74 74
 
75 75
     public function editUser(Association $association, User $user) {
76
-        return view('association.user.edit', ['association' => $association, 'user' => $user]);
76
+        return view('association.user.edit', [ 'association' => $association, 'user' => $user ]);
77 77
     }
78 78
 
79 79
     public function updateUser(Request $request, Association $association, User $user) {
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
             return redirect($url)->with('success', 'Data saved successfully!');
94 94
         }
95 95
 
96
-        return redirect()->route('user', ['id' => \Auth::user()->id]);
96
+        return redirect()->route('user', [ 'id' => \Auth::user()->id ]);
97 97
 
98 98
     }
99 99
 
100 100
     public function addUser(Association $association) {
101
-        return view('association.user.add', ['association' => $association]);
101
+        return view('association.user.add', [ 'association' => $association ]);
102 102
     }
103 103
 
104 104
     public function submitScoreBegin(Request $request) {
@@ -110,13 +110,13 @@  discard block
 block discarded – undo
110 110
 
111 111
             // get rounds with start_date < today, but greater than today - 1 week
112 112
             $rounds = Round::whereIn('schedule_id', $schedules->pluck('id'))
113
-                ->where('start_date','>=', date('Y-m-d', strtotime('-1 week')))
113
+                ->where('start_date', '>=', date('Y-m-d', strtotime('-1 week')))
114 114
                 ->where('start_date', '<=', date('Y-m-d', strtotime("today")))->get();
115 115
 
116 116
             $divisions = Division::whereIn('id', $rounds->pluck('division_id'))->get();
117 117
 
118 118
             if (count($divisions) === 1) {
119
-                $request->division_id = $divisions[0]->id;
119
+                $request->division_id = $divisions[ 0 ]->id;
120 120
 
121 121
                 return $this->submitScoreStep2($request);
122 122
             }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
             $rounds = Round::whereIn('schedule_id', $schedules->pluck('id'))
147 147
                 ->where('start_date', '>=', date('Y-m-d', strtotime('-1 week')))
148 148
                 ->where('start_date', '<=', date('Y-m-d', strtotime("today")))
149
-                ->where(function ($query) {
149
+                ->where(function($query) {
150 150
                     $query->where('scores_closed', 0);
151 151
                     $query->orWhereNull('scores_closed');
152 152
                 })
@@ -210,11 +210,11 @@  discard block
 block discarded – undo
210 210
     }
211 211
 
212 212
     public function standings() {
213
-        return view('association.standings', ['association' => $this->association]);
213
+        return view('association.standings', [ 'association' => $this->association ]);
214 214
     }
215 215
 
216 216
     public function schedule() {
217
-        return view('association.schedule', ['association' => $this->association]);
217
+        return view('association.schedule', [ 'association' => $this->association ]);
218 218
     }
219 219
 
220 220
     public function css() {
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
             $association->save();
240 240
 
241 241
             // TODO: Do not necessarily "onboard" for certain roles?
242
-            return redirect()->route('onboard.association', ['association' => $association]);
242
+            return redirect()->route('onboard.association', [ 'association' => $association ]);
243 243
         }
244 244
         else {
245 245
             return view('denied');
@@ -275,13 +275,13 @@  discard block
 block discarded – undo
275 275
             return redirect($url)->with('success', 'Data saved successfully!');
276 276
         }
277 277
 
278
-        return redirect()->route('user', ['id' => \Auth::user()->id]);
278
+        return redirect()->route('user', [ 'id' => \Auth::user()->id ]);
279 279
 
280 280
     }
281 281
 
282 282
     public function create() {
283 283
         if (Bouncer::can('create', Association::class)) {
284
-            return view('association.create', ['current_user' => \Auth::user()]);
284
+            return view('association.create', [ 'current_user' => \Auth::user() ]);
285 285
         }
286 286
         else {
287 287
             return view('denied');
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
     }
290 290
 
291 291
     public function deleteConfirm(Association $association) {
292
-        return view('association.delete', ['association' => $association]);
292
+        return view('association.delete', [ 'association' => $association ]);
293 293
     }
294 294
 
295 295
     public function delete(Association $association) {
@@ -299,13 +299,13 @@  discard block
 block discarded – undo
299 299
     }
300 300
 
301 301
     public function undeleteConfirm(Association $association) {
302
-        return view('association.undelete', ['association' => $association]);
302
+        return view('association.undelete', [ 'association' => $association ]);
303 303
     }
304 304
 
305 305
     public function undelete(Association $association) {
306 306
         $association->restore();
307 307
 
308
-        return redirect()->route('user', ['user' => \Auth::user()])->with('success', 'Association restored successfully.');
308
+        return redirect()->route('user', [ 'user' => \Auth::user() ])->with('success', 'Association restored successfully.');
309 309
     }
310 310
 
311 311
 
Please login to merge, or discard this patch.