@@ -16,7 +16,7 @@ |
||
16 | 16 | */ |
17 | 17 | public function handle($request, Closure $next) |
18 | 18 | { |
19 | - if (! app('settings')->withinGroupCreationPeriod()) { |
|
19 | + if ( ! app('settings')->withinGroupCreationPeriod()) { |
|
20 | 20 | flash('The group creation period is closed. You are not allowed to perform this action.')->error(); |
21 | 21 | |
22 | 22 | return redirect()->route('dashboard'); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function show($id) |
29 | 29 | { |
30 | - $data = DB::transaction(function () use ($id) { |
|
30 | + $data = DB::transaction(function() use ($id) { |
|
31 | 31 | $course = Course::findOrFail($id); |
32 | 32 | $enrollments = $course->enrollments() |
33 | 33 | ->with('student.user') |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function update(UpdateRequest $request, $id) |
52 | 52 | { |
53 | - DB::transaction(function () use ($request, $id) { |
|
53 | + DB::transaction(function() use ($request, $id) { |
|
54 | 54 | $course = Course::findOrFail($id); |
55 | 55 | |
56 | 56 | $course->fill($request->all()); |
@@ -25,11 +25,11 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function index() |
27 | 27 | { |
28 | - $courses = DB::transaction(function () { |
|
28 | + $courses = DB::transaction(function() { |
|
29 | 29 | return Course::orderedList()->get(); |
30 | 30 | }); |
31 | 31 | |
32 | - $courses = $courses->groupBy(function ($course) { |
|
32 | + $courses = $courses->groupBy(function($course) { |
|
33 | 33 | return $course->present()->getOrdinalYear(); |
34 | 34 | }); |
35 | 35 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function show($courseId) |
47 | 47 | { |
48 | - $groups = DB::transaction(function () use ($courseId) { |
|
48 | + $groups = DB::transaction(function() use ($courseId) { |
|
49 | 49 | return Group::with('memberships.student.user')->whereCourseId($courseId)->get(); |
50 | 50 | }); |
51 | 51 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function index($courseId) |
31 | 31 | { |
32 | - $invitations = DB::transaction(function () use ($courseId) { |
|
32 | + $invitations = DB::transaction(function() use ($courseId) { |
|
33 | 33 | return Invitation::with('group.memberships.student.user') |
34 | 34 | ->where([ |
35 | 35 | ['student_number', Auth::student()->student_number], |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | { |
82 | 82 | $courseId = 0; |
83 | 83 | |
84 | - $remainingInvitations = DB::transaction(function () use ($id, &$courseId) { |
|
84 | + $remainingInvitations = DB::transaction(function() use ($id, &$courseId) { |
|
85 | 85 | $invitation = Invitation::find($id) |
86 | 86 | ->whereStudentNumber(Auth::student()->student_number) |
87 | 87 | ->first(); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | ->get(); |
39 | 39 | |
40 | 40 | foreach ($enrollments as $enrollmentKey => $enrollment) { |
41 | - $course = DB::transaction(function () use ($enrollment) { |
|
41 | + $course = DB::transaction(function() use ($enrollment) { |
|
42 | 42 | return Course::whereId($enrollment->course_id)->first(); |
43 | 43 | }); |
44 | 44 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | if (is_null($membership)) { |
53 | 53 | $enrollment->group_status = 0; |
54 | 54 | } else { |
55 | - $group = DB::transaction(function () use ($membership) { |
|
55 | + $group = DB::transaction(function() use ($membership) { |
|
56 | 56 | return Group::with('memberships') |
57 | 57 | ->whereId($membership->group_id) |
58 | 58 | ->first(); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function store($courseId) |
85 | 85 | { |
86 | - $group = DB::transaction(function () use ($courseId) { |
|
86 | + $group = DB::transaction(function() use ($courseId) { |
|
87 | 87 | $course = Course::find($courseId); |
88 | 88 | |
89 | 89 | if ($course == null) { |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | { |
125 | 125 | $student = Auth::student(); |
126 | 126 | |
127 | - $course = DB::transaction(function () use ($courseId, $student) { |
|
127 | + $course = DB::transaction(function() use ($courseId, $student) { |
|
128 | 128 | $course = Course::whereId($courseId)->first(); |
129 | 129 | |
130 | 130 | $course->number_invitations = Invitation::ofStudentInCourse( |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | return $course; |
136 | 136 | }); |
137 | 137 | |
138 | - $membership = DB::transaction(function () use ($courseId, $student) { |
|
138 | + $membership = DB::transaction(function() use ($courseId, $student) { |
|
139 | 139 | return $student->memberships() |
140 | 140 | ->with('group.memberships.student.user') |
141 | 141 | ->whereCourseId($courseId) |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function update($inviteId) |
156 | 156 | { |
157 | - $invitation = DB::transaction(function () use ($inviteId) { |
|
157 | + $invitation = DB::transaction(function() use ($inviteId) { |
|
158 | 158 | return Invitation::with(['group.memberships', 'group.course']) |
159 | 159 | ->whereId($inviteId) |
160 | 160 | ->whereStudentNumber(Auth::student()->student_number) |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | |
209 | 209 | Auth::student()->leave($group); |
210 | 210 | |
211 | - if (! $group->memberships()->count()) { |
|
211 | + if ( ! $group->memberships()->count()) { |
|
212 | 212 | $invitations = Invitation::whereGroupId($group->id)->get(); |
213 | 213 | |
214 | 214 | foreach ($invitations as $invitation) { |
@@ -58,7 +58,7 @@ |
||
58 | 58 | */ |
59 | 59 | public static function create($studentNumber, $groupId, $courseId) |
60 | 60 | { |
61 | - $findAnyInvitation = DB::transaction(function () use ($studentNumber, $groupId) { |
|
61 | + $findAnyInvitation = DB::transaction(function() use ($studentNumber, $groupId) { |
|
62 | 62 | return self::where([ |
63 | 63 | ['student_number', $studentNumber], |
64 | 64 | ['group_id', $groupId], |
@@ -22,15 +22,15 @@ discard block |
||
22 | 22 | URL::forceScheme('https'); |
23 | 23 | } |
24 | 24 | |
25 | - Auth::macro('student', function () { |
|
25 | + Auth::macro('student', function() { |
|
26 | 26 | return Auth::check() ? Auth::user()->student : null; |
27 | 27 | }); |
28 | 28 | |
29 | - Validator::extend('student_number', function ($attribute, $value, $parameters, $validator) { |
|
29 | + Validator::extend('student_number', function($attribute, $value, $parameters, $validator) { |
|
30 | 30 | return preg_match('/^(a|pg)[0-9]+$/i', $value) === 1; |
31 | 31 | }); |
32 | 32 | |
33 | - Validator::extend('greater_or_equal_than_field', function ($attribute, $value, $parameters, $validator) { |
|
33 | + Validator::extend('greater_or_equal_than_field', function($attribute, $value, $parameters, $validator) { |
|
34 | 34 | $min_field = $parameters[0]; |
35 | 35 | $data = $validator->getData(); |
36 | 36 | $min_value = $data[$min_field]; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | return $value >= $min_value; |
39 | 39 | }); |
40 | 40 | |
41 | - Validator::replacer('greater_or_equal_than_field', function ($message, $attribute, $rule, $parameters) { |
|
41 | + Validator::replacer('greater_or_equal_than_field', function($message, $attribute, $rule, $parameters) { |
|
42 | 42 | return str_replace(':field', $parameters[0], $message); |
43 | 43 | }); |
44 | 44 | } |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function register() |
50 | 50 | { |
51 | - $this->app->singleton(ExchangeRegistry::class, function ($app) { |
|
51 | + $this->app->singleton(ExchangeRegistry::class, function($app) { |
|
52 | 52 | return new EloquentExchangeRegistry(); |
53 | 53 | }); |
54 | 54 | |
55 | - $this->app->singleton('settings', function ($app) { |
|
55 | + $this->app->singleton('settings', function($app) { |
|
56 | 56 | return Settings::firstOrNew([]); |
57 | 57 | }); |
58 | 58 | } |