@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function register() |
| 15 | 15 | { |
| 16 | - $this->app->singleton(SwapSolverService::class, function ($app) { |
|
| 16 | + $this->app->singleton(SwapSolverService::class, function($app) { |
|
| 17 | 17 | $uri = $this->app['config']->get('services.swapsolver.endpoint'); |
| 18 | 18 | $client = new Client(['base_uri' => $uri]); |
| 19 | 19 | |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | { |
| 24 | 24 | $this->registerPolicies(); |
| 25 | 25 | |
| 26 | - Gate::define('reply-group', function ($student, $group) { |
|
| 26 | + Gate::define('reply-group', function($student, $group) { |
|
| 27 | 27 | return $student->isInvitedToGroup($group); |
| 28 | 28 | }); |
| 29 | 29 | } |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public function handle($request, Closure $next) |
| 18 | 18 | { |
| 19 | - if (! app('settings')->withinGroupPeriod()) { |
|
| 19 | + if ( ! app('settings')->withinGroupPeriod()) { |
|
| 20 | 20 | flash('The groups period is closed. You are not allowed to perform this action.')->error(); |
| 21 | 21 | |
| 22 | 22 | return redirect()->route('dashboard'); |
@@ -28,13 +28,13 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function confirm(Group $group) |
| 30 | 30 | { |
| 31 | - $student = DB::transaction(function () { |
|
| 31 | + $student = DB::transaction(function() { |
|
| 32 | 32 | return Auth::user()->student; |
| 33 | 33 | }); |
| 34 | 34 | |
| 35 | 35 | $this->authorize('reply-group', [$student, $group]); |
| 36 | 36 | |
| 37 | - DB::transaction(function () use ($student, $group) { |
|
| 37 | + DB::transaction(function() use ($student, $group) { |
|
| 38 | 38 | return $student->confirmGroup($group); |
| 39 | 39 | }); |
| 40 | 40 | flash('The group request was successfully confirmed.')->success(); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | $this->authorize('reply-group', [$student, $group]); |
| 57 | 57 | |
| 58 | - DB::transaction(function () use ($student, $group) { |
|
| 58 | + DB::transaction(function() use ($student, $group) { |
|
| 59 | 59 | return $student->declineGroup($group); |
| 60 | 60 | }); |
| 61 | 61 | flash('The group request was successfully declined.')->success(); |
@@ -35,11 +35,11 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | $student = Auth::student(); |
| 37 | 37 | |
| 38 | - $pendingGroups = DB::transaction(function () use ($student) { |
|
| 38 | + $pendingGroups = DB::transaction(function() use ($student) { |
|
| 39 | 39 | return $student->pendingGroups()->get(); |
| 40 | 40 | }); |
| 41 | 41 | |
| 42 | - $confirmedGroups = DB::transaction(function () use ($student) { |
|
| 42 | + $confirmedGroups = DB::transaction(function() use ($student) { |
|
| 43 | 43 | return $student->confirmedGroups()->get(); |
| 44 | 44 | }); |
| 45 | 45 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | $groups = DB::table('groups')->get(); |
| 53 | 53 | |
| 54 | - $courses = DB::transaction(function () { |
|
| 54 | + $courses = DB::transaction(function() { |
|
| 55 | 55 | return Course::orderedList()->get(); |
| 56 | 56 | }); |
| 57 | 57 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | 'course_id' => 'required' |
| 78 | 78 | ]); |
| 79 | 79 | |
| 80 | - DB::transaction(function () use ($atributtes){ |
|
| 80 | + DB::transaction(function() use ($atributtes){ |
|
| 81 | 81 | $creator = Auth::student(); |
| 82 | 82 | $course = Course::findOrFail($atributtes['course_id']); |
| 83 | 83 | |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | public function export() |
| 146 | 146 | { |
| 147 | 147 | |
| 148 | - $groups = DB::transaction(function () { |
|
| 149 | - $groups = Group::with('course','students') |
|
| 148 | + $groups = DB::transaction(function() { |
|
| 149 | + $groups = Group::with('course', 'students') |
|
| 150 | 150 | ->get() |
| 151 | 151 | ->sortByDesc('courses.name'); |
| 152 | 152 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | fputs($handle, $groups->toJson(JSON_PRETTY_PRINT)); |
| 159 | 159 | fclose($handle); |
| 160 | 160 | $headers = array('Content-type'=> 'application/json'); |
| 161 | - return response()->download($filename,'groups.json',$headers); |
|
| 161 | + return response()->download($filename, 'groups.json', $headers); |
|
| 162 | 162 | |
| 163 | 163 | } |
| 164 | 164 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | protected $fillable = ['name']; |
| 18 | 18 | |
| 19 | - protected $visible = ['id','course','students']; |
|
| 19 | + protected $visible = ['id', 'course', 'students']; |
|
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * Get course of this group. |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | */ |
| 152 | 152 | public function removeMember(Student $member) |
| 153 | 153 | { |
| 154 | - if (! $member->isAssociatedToGroup($this)) { |
|
| 154 | + if ( ! $member->isAssociatedToGroup($this)) { |
|
| 155 | 155 | return $this; |
| 156 | 156 | } |
| 157 | 157 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | protected $fillable = ['student_number']; |
| 27 | 27 | |
| 28 | - protected $visible = ['user','student_number']; |
|
| 28 | + protected $visible = ['user', 'student_number']; |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * Get user who owns this student. |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | throw new StudentIsNotEnrolledInCourseException($course); |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | - if (! $enrollment->isDeletable()) { |
|
| 193 | + if ( ! $enrollment->isDeletable()) { |
|
| 194 | 194 | throw new EnrollmentCannotBeDeleted($enrollment); |
| 195 | 195 | } |
| 196 | 196 | |
@@ -323,8 +323,8 @@ discard block |
||
| 323 | 323 | { |
| 324 | 324 | $enrollments = $this->enrollments()->get(); |
| 325 | 325 | $courses = collect([]); |
| 326 | - foreach($enrollments as $enrollment) { |
|
| 327 | - if(! $this->hasGroupInCourse($enrollment->course()->first())) { |
|
| 326 | + foreach ($enrollments as $enrollment) { |
|
| 327 | + if ( ! $this->hasGroupInCourse($enrollment->course()->first())) { |
|
| 328 | 328 | $courses->prepend($enrollment->course()->first()); |
| 329 | 329 | } |
| 330 | 330 | } |