@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | protected function mapWebRoutes() |
54 | 54 | { |
55 | 55 | Route::middleware('web') |
56 | - ->namespace($this->namespace) |
|
57 | - ->group(base_path('routes/web.php')); |
|
56 | + ->namespace($this->namespace) |
|
57 | + ->group(base_path('routes/web.php')); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | protected function mapApiRoutes() |
68 | 68 | { |
69 | 69 | Route::prefix('api') |
70 | - ->middleware('api') |
|
71 | - ->namespace($this->namespace) |
|
72 | - ->group(base_path('routes/api.php')); |
|
70 | + ->middleware('api') |
|
71 | + ->namespace($this->namespace) |
|
72 | + ->group(base_path('routes/api.php')); |
|
73 | 73 | } |
74 | 74 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | protected function commands() |
37 | 37 | { |
38 | - $this->load(__DIR__.'/Commands'); |
|
38 | + $this->load(__DIR__ . '/Commands'); |
|
39 | 39 | |
40 | 40 | require base_path('routes/console.php'); |
41 | 41 | } |
@@ -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 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | protected function redirectTo($request) |
16 | 16 | { |
17 | - if (! $request->expectsJson()) { |
|
17 | + if (!$request->expectsJson()) { |
|
18 | 18 | return route('login'); |
19 | 19 | } |
20 | 20 | } |
@@ -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 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | */ |
16 | 16 | public function handle($request, Closure $next) |
17 | 17 | { |
18 | - \URL::defaults(['subdomain' => request('subdomain')]); |
|
18 | + \URL::defaults([ 'subdomain' => request('subdomain') ]); |
|
19 | 19 | |
20 | 20 | return $next($request); |
21 | 21 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | return redirect($request->url)->with('success', 'Data saved successfully!'); |
31 | 31 | } |
32 | 32 | |
33 | - return redirect()->route('user', ['id' => \Auth::user()->id]); |
|
33 | + return redirect()->route('user', [ 'id' => \Auth::user()->id ]); |
|
34 | 34 | } |
35 | 35 | else { |
36 | 36 | return view('denied'); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | public function update(Association $association, Team $team, Request $request) { |
41 | 41 | if (Bouncer::can('update', Team::class)) { |
42 | - $team = Team::where(['id' => $team->id])->first(); |
|
42 | + $team = Team::where([ 'id' => $team->id ])->first(); |
|
43 | 43 | |
44 | 44 | $team->name = $request->name; |
45 | 45 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | return redirect($request->url)->with('success', 'Data saved successfully!'); |
50 | 50 | } |
51 | 51 | |
52 | - return redirect()->route('user', ['id' => \Auth::user()->id]); |
|
52 | + return redirect()->route('user', [ 'id' => \Auth::user()->id ]); |
|
53 | 53 | } |
54 | 54 | else { |
55 | 55 | return view('denied'); |
@@ -57,12 +57,12 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | public function edit(Association $association, Team $team) { |
60 | - return view('team.edit', ['team' => $team]); |
|
60 | + return view('team.edit', [ 'team' => $team ]); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | public function deleteConfirm(Association $association, Team $team) { |
64 | 64 | if (Bouncer::can('delete', $team)) { |
65 | - return view('team.delete', ['team' => $team]); |
|
65 | + return view('team.delete', [ 'team' => $team ]); |
|
66 | 66 | } |
67 | 67 | else { |
68 | 68 | return view('denied'); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | if (Bouncer::can('delete', $team)) { |
74 | 74 | $team->delete(); |
75 | 75 | |
76 | - return redirect()->route('association.teams', ['association' => $association])->with('success', 'Team deleted successfully.'); |
|
76 | + return redirect()->route('association.teams', [ 'association' => $association ])->with('success', 'Team deleted successfully.'); |
|
77 | 77 | } |
78 | 78 | else { |
79 | 79 | return view('denied'); |
@@ -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 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | return redirect($request->url)->with('success', 'Data saved successfully!'); |
31 | 31 | } |
32 | 32 | |
33 | - return redirect()->route('user', ['id' => \Auth::user()->id]); |
|
33 | + return redirect()->route('user', [ 'id' => \Auth::user()->id ]); |
|
34 | 34 | } |
35 | 35 | else { |
36 | 36 | return view('denied'); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | return redirect($request->url)->with('success', 'Data saved successfully!'); |
50 | 50 | } |
51 | 51 | |
52 | - return redirect()->route('user', ['id' => \Auth::user()->id]); |
|
52 | + return redirect()->route('user', [ 'id' => \Auth::user()->id ]); |
|
53 | 53 | } |
54 | 54 | else { |
55 | 55 | return view('denied'); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | public function deleteConfirm(Association $association, Division $division) { |
72 | 72 | if (Bouncer::can('delete', $division)) { |
73 | - return view('division.delete', ['division' => $division]); |
|
73 | + return view('division.delete', [ 'division' => $division ]); |
|
74 | 74 | } |
75 | 75 | else { |
76 | 76 | return view('denied'); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | if (Bouncer::can('delete', $division)) { |
82 | 82 | $division->delete(); |
83 | 83 | |
84 | - return redirect()->route('association.divisions', ['association' => $association])->with('success', 'Division deleted successfully.'); |
|
84 | + return redirect()->route('association.divisions', [ 'association' => $association ])->with('success', 'Division deleted successfully.'); |
|
85 | 85 | } |
86 | 86 | else { |
87 | 87 | return view('denied'); |
@@ -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 | } |
@@ -25,7 +25,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | // get rounds with start_date < today, but greater than today - 1 week |
146 | 146 | $rounds = Round::whereIn('schedule_id', $schedules->pluck('id')) |
147 | - ->where('start_date','>=', date('Y-m-d', strtotime('-1 week'))) |
|
147 | + ->where('start_date', '>=', date('Y-m-d', strtotime('-1 week'))) |
|
148 | 148 | ->where('start_date', '<=', date('Y-m-d', strtotime("today"))) |
149 | 149 | ->orderBy('start_date', 'DESC') |
150 | 150 | ->get(); |
@@ -206,11 +206,11 @@ discard block |
||
206 | 206 | } |
207 | 207 | |
208 | 208 | public function standings() { |
209 | - return view('association.standings', ['association' => $this->association]); |
|
209 | + return view('association.standings', [ 'association' => $this->association ]); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | public function schedule() { |
213 | - return view('association.schedule', ['association' => $this->association]); |
|
213 | + return view('association.schedule', [ 'association' => $this->association ]); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | public function css() { |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $association->save(); |
236 | 236 | |
237 | 237 | // TODO: Do not necessarily "onboard" for certain roles? |
238 | - return redirect()->route('onboard.association', ['association' => $association]); |
|
238 | + return redirect()->route('onboard.association', [ 'association' => $association ]); |
|
239 | 239 | } |
240 | 240 | else { |
241 | 241 | return view('denied'); |
@@ -271,13 +271,13 @@ discard block |
||
271 | 271 | return redirect($url)->with('success', 'Data saved successfully!'); |
272 | 272 | } |
273 | 273 | |
274 | - return redirect()->route('user', ['id' => \Auth::user()->id]); |
|
274 | + return redirect()->route('user', [ 'id' => \Auth::user()->id ]); |
|
275 | 275 | |
276 | 276 | } |
277 | 277 | |
278 | 278 | public function create() { |
279 | 279 | if (Bouncer::can('create', Association::class)) { |
280 | - return view('association.create', ['current_user' => \Auth::user()]); |
|
280 | + return view('association.create', [ 'current_user' => \Auth::user() ]); |
|
281 | 281 | } |
282 | 282 | else { |
283 | 283 | return view('denied'); |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | } |
286 | 286 | |
287 | 287 | public function deleteConfirm(Association $association) { |
288 | - return view('association.delete', ['association' => $association]); |
|
288 | + return view('association.delete', [ 'association' => $association ]); |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | public function delete(Association $association) { |
@@ -295,13 +295,13 @@ discard block |
||
295 | 295 | } |
296 | 296 | |
297 | 297 | public function undeleteConfirm(Association $association) { |
298 | - return view('association.undelete', ['association' => $association]); |
|
298 | + return view('association.undelete', [ 'association' => $association ]); |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | public function undelete(Association $association) { |
302 | 302 | $association->restore(); |
303 | 303 | |
304 | - return redirect()->route('user', ['user' => \Auth::user()])->with('success', 'Association restored successfully.'); |
|
304 | + return redirect()->route('user', [ 'user' => \Auth::user() ])->with('success', 'Association restored successfully.'); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 |
@@ -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 | } |