@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | public function store($id) |
| 31 | 31 | { |
| 32 | 32 | try { |
| 33 | - $course = DB::transaction(function () use ($id) { |
|
| 33 | + $course = DB::transaction(function() use ($id) { |
|
| 34 | 34 | $course = Course::findOrFail($id); |
| 35 | 35 | Auth::student()->enroll($course); |
| 36 | 36 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function destroy($id) |
| 57 | 57 | { |
| 58 | - $course = DB::transaction(function () use ($id) { |
|
| 58 | + $course = DB::transaction(function() use ($id) { |
|
| 59 | 59 | $course = Course::findOrFail($id); |
| 60 | 60 | Auth::student()->unenroll($course); |
| 61 | 61 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function confirm($id) |
| 33 | 33 | { |
| 34 | - $exchange = DB::transaction(function () use ($id) { |
|
| 34 | + $exchange = DB::transaction(function() use ($id) { |
|
| 35 | 35 | $exchange = Auth::student()->proposedExchanges()->findOrFail($id); |
| 36 | 36 | |
| 37 | 37 | return $exchange->perform(); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function decline($id) |
| 53 | 53 | { |
| 54 | - $exchange = DB::transaction(function () use ($id) { |
|
| 54 | + $exchange = DB::transaction(function() use ($id) { |
|
| 55 | 55 | $exchange = Auth::student()->proposedExchanges()->findOrFail($id); |
| 56 | 56 | $exchange->delete(); |
| 57 | 57 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function destroy($id) |
| 74 | 74 | { |
| 75 | - DB::transaction(function () use ($id) { |
|
| 75 | + DB::transaction(function() use ($id) { |
|
| 76 | 76 | Auth::student()->requestedExchanges()->findOrFail($id)->delete(); |
| 77 | 77 | }); |
| 78 | 78 | flash('The shift exchange request was successfully deleted.')->success(); |
@@ -35,13 +35,13 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | protected function adminDashboard() |
| 37 | 37 | { |
| 38 | - $courses = DB::transaction(function () { |
|
| 38 | + $courses = DB::transaction(function() { |
|
| 39 | 39 | return Course::withCount('enrollments') |
| 40 | 40 | ->orderedList() |
| 41 | 41 | ->get(); |
| 42 | 42 | }); |
| 43 | 43 | |
| 44 | - $courses = $courses->groupBy(function ($course) { |
|
| 44 | + $courses = $courses->groupBy(function($course) { |
|
| 45 | 45 | return $course->present()->getOrdinalYear(); |
| 46 | 46 | }); |
| 47 | 47 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | protected function studentDashboard() |
| 57 | 57 | { |
| 58 | - $data = DB::transaction(function () { |
|
| 58 | + $data = DB::transaction(function() { |
|
| 59 | 59 | $proposedExchanges = Auth::student()->proposedExchanges()->get(); |
| 60 | 60 | $requestedExchanges = Auth::student()->requestedExchanges()->get(); |
| 61 | 61 | $enrollments = Auth::student()->enrollments() |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | return compact('proposedExchanges', 'requestedExchanges', 'enrollments'); |
| 67 | 67 | }); |
| 68 | 68 | |
| 69 | - $data['enrollments'] = $data['enrollments']->groupBy(function ($enrollment) { |
|
| 69 | + $data['enrollments'] = $data['enrollments']->groupBy(function($enrollment) { |
|
| 70 | 70 | return $enrollment->course->present()->getOrdinalYear(); |
| 71 | 71 | }); |
| 72 | 72 | |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function index(ExchangeRegistry $registry) |
| 26 | 26 | { |
| 27 | - $history = DB::transaction(function () use ($registry) { |
|
| 27 | + $history = DB::transaction(function() use ($registry) { |
|
| 28 | 28 | return $registry->paginate(); |
| 29 | 29 | }); |
| 30 | 30 | |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function show($id) |
| 28 | 28 | { |
| 29 | - $data = DB::transaction(function () use ($id) { |
|
| 29 | + $data = DB::transaction(function() use ($id) { |
|
| 30 | 30 | $course = Course::findOrFail($id); |
| 31 | 31 | $enrollments = $course->enrollments() |
| 32 | 32 | ->with('student.user') |
@@ -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(); |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | public function show($id, ExchangeRegistry $exchangeLogger) |
| 20 | 20 | { |
| 21 | - $data = DB::transaction(function () use ($id, $exchangeLogger) { |
|
| 21 | + $data = DB::transaction(function() use ($id, $exchangeLogger) { |
|
| 22 | 22 | $data = []; |
| 23 | 23 | $student = Student::findOrFail($id); |
| 24 | 24 | $data['student'] = $student; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | // Group all enrollments by the year of their associated course, so |
| 38 | 38 | // the enrollments listing is organized by year. This will allow |
| 39 | 39 | // a better experience, since it matches the official order. |
| 40 | - $data['enrollments'] = $data['enrollments']->groupBy(function ($enrollment) { |
|
| 40 | + $data['enrollments'] = $data['enrollments']->groupBy(function($enrollment) { |
|
| 41 | 41 | return $enrollment->course->present()->getOrdinalYear(); |
| 42 | 42 | }); |
| 43 | 43 | |