@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function export() |
33 | 33 | { |
34 | 34 | // Get the list of students enrolled on each course |
35 | - $enrollments = DB::transaction(function () { |
|
35 | + $enrollments = DB::transaction(function() { |
|
36 | 36 | $enrollments = Enrollment::with('student', 'course') |
37 | 37 | ->get() |
38 | 38 | ->sortByDesc('courses.name'); |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | }); |
42 | 42 | |
43 | 43 | // Export to CSV |
44 | - $result = Excel::create('enrollments', function ($excel) use ($enrollments) { |
|
45 | - $excel->sheet('Enrollments', function ($sheet) use ($enrollments) { |
|
44 | + $result = Excel::create('enrollments', function($excel) use ($enrollments) { |
|
45 | + $excel->sheet('Enrollments', function($sheet) use ($enrollments) { |
|
46 | 46 | $sheet->loadView('enrollments.export', compact('enrollments')); |
47 | 47 | }); |
48 | 48 | }); |
@@ -63,10 +63,10 @@ discard block |
||
63 | 63 | $file = $request->enrollments; |
64 | 64 | $path = $file->path(); |
65 | 65 | |
66 | - Excel::load($path, function ($reader) { |
|
67 | - DB::transaction(function () use ($reader) { |
|
66 | + Excel::load($path, function($reader) { |
|
67 | + DB::transaction(function() use ($reader) { |
|
68 | 68 | // Loop for all the rows of the table |
69 | - $reader->each(function ($row, $index) { |
|
69 | + $reader->each(function($row, $index) { |
|
70 | 70 | $index += 2; // Skip header |
71 | 71 | |
72 | 72 | // Get the models of the given ids |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public function update(UpdateRequest $request) |
39 | 39 | { |
40 | - DB::transaction(function () use ($request) { |
|
40 | + DB::transaction(function() use ($request) { |
|
41 | 41 | app('settings')->update($request->all()); |
42 | 42 | }); |
43 | 43 | flash('Settings were successfully updated.')->success(); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function store($id) |
33 | 33 | { |
34 | 34 | try { |
35 | - $course = DB::transaction(function () use ($id) { |
|
35 | + $course = DB::transaction(function() use ($id) { |
|
36 | 36 | $course = Course::findOrFail($id); |
37 | 37 | Auth::student()->enroll($course); |
38 | 38 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public function destroy($id) |
57 | 57 | { |
58 | 58 | try { |
59 | - $course = DB::transaction(function () use ($id) { |
|
59 | + $course = DB::transaction(function() use ($id) { |
|
60 | 60 | $course = Course::findOrFail($id); |
61 | 61 | Auth::student()->unenroll($course); |
62 | 62 |
@@ -72,11 +72,11 @@ |
||
72 | 72 | */ |
73 | 73 | public function setExchangeEnrollments(Enrollment $from, Enrollment $to) : self |
74 | 74 | { |
75 | - if (! $from->availableForExchange() || is_null($to->shift)) { |
|
75 | + if ( ! $from->availableForExchange() || is_null($to->shift)) { |
|
76 | 76 | throw new EnrollmentCannotBeExchangedException(); |
77 | 77 | } |
78 | 78 | |
79 | - if (! $from->course->is($to->course)) { |
|
79 | + if ( ! $from->course->is($to->course)) { |
|
80 | 80 | throw new ExchangeEnrollmentsOnDifferentCoursesException(); |
81 | 81 | } |
82 | 82 |
@@ -39,9 +39,9 @@ |
||
39 | 39 | */ |
40 | 40 | public function handle() |
41 | 41 | { |
42 | - DB::transaction(function () { |
|
42 | + DB::transaction(function() { |
|
43 | 43 | $students = Student::with('user')->get(); |
44 | - $students->each(function ($student) { |
|
44 | + $students->each(function($student) { |
|
45 | 45 | $user = $student->user; |
46 | 46 | if ($user->verified) { |
47 | 47 | return; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | protected function validator(array $data) |
50 | 50 | { |
51 | - if (! is_null($data['student_number'])) { |
|
51 | + if ( ! is_null($data['student_number'])) { |
|
52 | 52 | $data['student_number'] = strtolower($data['student_number']); |
53 | 53 | } |
54 | 54 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | protected function create(array $data) |
70 | 70 | { |
71 | - $user = DB::transaction(function () use ($data) { |
|
71 | + $user = DB::transaction(function() use ($data) { |
|
72 | 72 | $data['student_number'] = strtolower($data['student_number']); |
73 | 73 | $user = User::make([ |
74 | 74 | 'name' => $data['name'], |
@@ -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'); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | */ |
40 | 40 | public function handle() |
41 | 41 | { |
42 | - DB::transaction(function () { |
|
42 | + DB::transaction(function() { |
|
43 | 43 | // Delete exchange registry. |
44 | 44 | resolve(ExchangeRegistry::class)->truncate(); |
45 | 45 |
@@ -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()); |