@@ -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 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | { |
| 18 | 18 | |
| 19 | 19 | // Check if is allowed and set default locale if not |
| 20 | - if (! language()->allowed($locale)) { |
|
| 20 | + if (!language()->allowed($locale)) { |
|
| 21 | 21 | $locale = config('app.locale'); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | // get past events for the course |
| 117 | - $events = $course->events->filter(function ($value, $key) { |
|
| 117 | + $events = $course->events->filter(function($value, $key) { |
|
| 118 | 118 | return Carbon::parse($value->start) < Carbon::now(); |
| 119 | 119 | })->sortByDesc('start'); |
| 120 | 120 | |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | |
| 200 | 200 | public function toggleEventAttendanceStatus(Event $event, Request $request) |
| 201 | 201 | { |
| 202 | - if (! backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 202 | + if (!backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 203 | 203 | abort(403); |
| 204 | 204 | } |
| 205 | 205 | $event->exempt_attendance = (int) $request->status; |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | |
| 211 | 211 | public function toggleCourseAttendanceStatus(Course $course, Request $request) |
| 212 | 212 | { |
| 213 | - if (! backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 213 | + if (!backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 214 | 214 | abort(403); |
| 215 | 215 | } |
| 216 | 216 | $course->exempt_attendance = (int) $request->status; |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | $rooms = Room::all()->toArray(); |
| 25 | 25 | |
| 26 | - $rooms = array_map(function ($room) { |
|
| 26 | + $rooms = array_map(function($room) { |
|
| 27 | 27 | return [ |
| 28 | 28 | 'id' => $room['id'], |
| 29 | 29 | 'title' => $room['name'], |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | array_push($rooms, ['id' => 'tbd', 'title' => 'Unassigned']); |
| 34 | 34 | |
| 35 | - $events = array_map(function ($event) { |
|
| 35 | + $events = array_map(function($event) { |
|
| 36 | 36 | return [ |
| 37 | 37 | 'title' => $event['name'], |
| 38 | 38 | 'resourceId' => $event['room_id'], |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | $unassigned_events = Event::where('room_id', null)->get()->toArray(); |
| 48 | 48 | |
| 49 | - $unassigned_events = array_map(function ($event) { |
|
| 49 | + $unassigned_events = array_map(function($event) { |
|
| 50 | 50 | return [ |
| 51 | 51 | 'title' => $event['name'], |
| 52 | 52 | 'resourceId' => 'tbd', |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | public function show(Room $room) |
| 72 | 72 | { |
| 73 | 73 | $events = $room->events->toArray(); |
| 74 | - $events = array_map(function ($event) { |
|
| 74 | + $events = array_map(function($event) { |
|
| 75 | 75 | return [ |
| 76 | 76 | 'title' => $event['name'], |
| 77 | 77 | 'start' => $event['start'], |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | { |
| 11 | 11 | public function get() |
| 12 | 12 | { |
| 13 | - if (! backpack_user()->hasPermissionTo('enrollments.edit')) { |
|
| 13 | + if (!backpack_user()->hasPermissionTo('enrollments.edit')) { |
|
| 14 | 14 | abort(403); |
| 15 | 15 | } |
| 16 | 16 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | public function update(UpdateConfigRequest $request) |
| 25 | 25 | { |
| 26 | - if (! backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 26 | + if (!backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 27 | 27 | abort(403); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -135,7 +135,7 @@ |
||
| 135 | 135 | |
| 136 | 136 | public function import(Course $course, Request $request) |
| 137 | 137 | { |
| 138 | - if (! $request->hasFile('skillset')) { |
|
| 138 | + if (!$request->hasFile('skillset')) { |
|
| 139 | 139 | abort(422, 'No file has been uploaded'); |
| 140 | 140 | } |
| 141 | 141 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | $teachers = Teacher::with('user')->get()->toArray(); |
| 27 | 27 | |
| 28 | - $teachers = array_map(function ($teacher) { |
|
| 28 | + $teachers = array_map(function($teacher) { |
|
| 29 | 29 | return [ |
| 30 | 30 | 'id' => $teacher['id'], |
| 31 | 31 | 'title' => $teacher['user']['firstname'], |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | array_push($teachers, ['id' => 'tbd', 'title' => 'Unassigned']); |
| 36 | 36 | |
| 37 | - $events = array_map(function ($event) { |
|
| 37 | + $events = array_map(function($event) { |
|
| 38 | 38 | return [ |
| 39 | 39 | 'title' => $event['name'], |
| 40 | 40 | 'resourceId' => $event['teacher_id'], |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | $unassigned_events = Event::where('teacher_id', null)->get()->toArray(); |
| 50 | 50 | |
| 51 | - $unassigned_events = array_map(function ($event) { |
|
| 51 | + $unassigned_events = array_map(function($event) { |
|
| 52 | 52 | return [ |
| 53 | 53 | 'title' => $event['name'], |
| 54 | 54 | 'resourceId' => 'tbd', |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | $leaves = Leave::orderBy('date', 'desc')->limit(10000)->get()->toArray(); |
| 64 | 64 | |
| 65 | - $leaves = array_map(function ($event) { |
|
| 65 | + $leaves = array_map(function($event) { |
|
| 66 | 66 | return [ |
| 67 | 67 | 'title' => $event->leaveType->name ?? 'ABS', // todo fix |
| 68 | 68 | 'resourceId' => $event['teacher_id'], |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | $events = $teacher->events->toArray(); |
| 94 | - $events = array_map(function ($event) { |
|
| 94 | + $events = array_map(function($event) { |
|
| 95 | 95 | return [ |
| 96 | 96 | 'title' => $event['name'], |
| 97 | 97 | 'start' => $event['start'], |
@@ -102,9 +102,9 @@ discard block |
||
| 102 | 102 | }, $events); |
| 103 | 103 | |
| 104 | 104 | $leaves = $teacher->leaves->toArray(); |
| 105 | - $leaves = array_map(function ($event) { |
|
| 105 | + $leaves = array_map(function($event) { |
|
| 106 | 106 | return [ |
| 107 | - 'title' => $event->leaveType->name ?? 'vacances', // todo fix |
|
| 107 | + 'title' => $event->leaveType->name ?? 'vacances', // todo fix |
|
| 108 | 108 | 'start' => $event['date'], |
| 109 | 109 | 'allDay' => true, |
| 110 | 110 | ]; |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | { |
| 39 | 39 | $period = Period::get_default_period(); |
| 40 | 40 | |
| 41 | - if (! isset($request->period)) { |
|
| 41 | + if (!isset($request->period)) { |
|
| 42 | 42 | $startperiod = Period::find(Config::where('name', 'first_period')->first()->value); |
| 43 | 43 | } else { |
| 44 | 44 | $startperiod = Period::find($request->period); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | public function update(Contact $contact, Request $request) |
| 58 | 58 | { |
| 59 | 59 | // check if the user is allowed to edit the contact |
| 60 | - if (! backpack_user()->can('update', $contact)) { |
|
| 60 | + if (!backpack_user()->can('update', $contact)) { |
|
| 61 | 61 | abort(403); |
| 62 | 62 | } |
| 63 | 63 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | public function edit(Contact $contact) |
| 96 | 96 | { |
| 97 | 97 | // check if the user is allowed to edit the contact |
| 98 | - if (! backpack_user()->can('update', $contact)) { |
|
| 98 | + if (!backpack_user()->can('update', $contact)) { |
|
| 99 | 99 | abort(403); |
| 100 | 100 | } |
| 101 | 101 | |