@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | protected function mapWebRoutes() |
53 | 53 | { |
54 | 54 | Route::middleware('web') |
55 | - ->namespace($this->namespace) |
|
56 | - ->group(base_path('routes/web.php')); |
|
55 | + ->namespace($this->namespace) |
|
56 | + ->group(base_path('routes/web.php')); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | protected function mapApiRoutes() |
67 | 67 | { |
68 | 68 | Route::prefix('api') |
69 | - ->middleware('api') |
|
70 | - ->namespace($this->namespace) |
|
71 | - ->group(base_path('routes/api.php')); |
|
69 | + ->middleware('api') |
|
70 | + ->namespace($this->namespace) |
|
71 | + ->group(base_path('routes/api.php')); |
|
72 | 72 | } |
73 | 73 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | private function setLocale(string $locale) |
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 |
@@ -228,8 +228,8 @@ |
||
228 | 228 | $user = Student::where('id', $this->guard()->user()->id)->first(); |
229 | 229 | |
230 | 230 | $user |
231 | - ->addMedia($request->fileToUpload) |
|
232 | - ->toMediaCollection('profile-picture'); |
|
231 | + ->addMedia($request->fileToUpload) |
|
232 | + ->toMediaCollection('profile-picture'); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | // if the user has been selected for a forced update, move to the next step |
@@ -23,7 +23,7 @@ |
||
23 | 23 | parent::boot(); |
24 | 24 | |
25 | 25 | // when an attendance record is added, we check if this is an absence |
26 | - static::saved(function (self $attendance) { |
|
26 | + static::saved(function(self $attendance) { |
|
27 | 27 | if ($attendance->attendance_type_id == 4) { // todo move to configurable settings |
28 | 28 | // Log::info('Absence marked for student '.$attendance->student->name); |
29 | 29 | // will check the record again and send a notification if it hasn't changed |
@@ -49,7 +49,7 @@ |
||
49 | 49 | parent::boot(); |
50 | 50 | |
51 | 51 | // when a result is added, send a notification |
52 | - static::saved(function (self $result) { |
|
52 | + static::saved(function(self $result) { |
|
53 | 53 | Mail::to($result->enrollment->student->user->email) |
54 | 54 | ->locale($result->enrollment->student->user->locale) |
55 | 55 | ->queue(new ResultNotification($result->enrollment->course, $result->enrollment->student->user)); |
@@ -10,9 +10,9 @@ |
||
10 | 10 | public function __invoke(Builder $query, $value, string $property) |
11 | 11 | { |
12 | 12 | $value = collect($value)->toArray(); |
13 | - $query->where(function (Builder $query) use ($value) { |
|
13 | + $query->where(function(Builder $query) use ($value) { |
|
14 | 14 | $query->whereIn('level_id', $value) |
15 | - ->orWhereHas('children', function (Builder $query) use ($value) { |
|
15 | + ->orWhereHas('children', function(Builder $query) use ($value) { |
|
16 | 16 | $query->whereIn('level_id', $value); |
17 | 17 | }); |
18 | 18 | }); |
@@ -39,7 +39,8 @@ discard block |
||
39 | 39 | |
40 | 40 | public function search() |
41 | 41 | { |
42 | - return QueryBuilder::for(Course::class)->where('campus_id', 1) |
|
42 | + return QueryBuilder::for(Course::class) { |
|
43 | + ->where('campus_id', 1) |
|
43 | 44 | ->with('room')->withCount('events')->withCount('children')->withCount('enrollments') |
44 | 45 | ->allowedFilters([ |
45 | 46 | 'name', |
@@ -49,6 +50,7 @@ discard block |
||
49 | 50 | AllowedFilter::exact('teacher_id'), |
50 | 51 | ]) |
51 | 52 | ->get(); |
53 | + } |
|
52 | 54 | } |
53 | 55 | |
54 | 56 | public function redirectToUserPreferredView() |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | public function search() |
40 | 40 | { |
41 | - return QueryBuilder::for(Course::class)->where('campus_id', 1) |
|
41 | + return QueryBuilder::for (Course::class)->where('campus_id', 1) |
|
42 | 42 | ->with('room')->withCount('events')->withCount('children')->withCount('enrollments') |
43 | 43 | ->allowedFilters([ |
44 | 44 | 'name', |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | public function redirectToUserPreferredView() |
54 | 54 | { |
55 | - return match (backpack_user()->preferred_course_view) { |
|
55 | + return match(backpack_user()->preferred_course_view) { |
|
56 | 56 | 'blocks' => redirect(route('get-courses-list')), |
57 | 57 | default => redirect(route('course.index')), |
58 | 58 | }; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $year_data = []; |
63 | 63 | $years = []; // New array |
64 | 64 | |
65 | - if (! isset($request->period)) { |
|
65 | + if (!isset($request->period)) { |
|
66 | 66 | $startperiod = Period::find(Config::where('name', 'first_external_period')->first()->value ?? Period::first()->id); |
67 | 67 | } else { |
68 | 68 | $startperiod = Period::find($request->period); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | { |
164 | 164 | $period = Period::get_default_period(); |
165 | 165 | |
166 | - if (! isset($request->period)) { |
|
166 | + if (!isset($request->period)) { |
|
167 | 167 | $startperiod = Period::find(Config::where('name', 'first_period')->first()->value); |
168 | 168 | } else { |
169 | 169 | $startperiod = Period::find($request->period); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | CRUD::addField(['name' => 'name', 'label' => 'Name', 'type' => 'text']); |
37 | 37 | |
38 | - CRUD::addField([ // Select2Multiple = n-n relationship (with pivot table) |
|
38 | + CRUD::addField([// Select2Multiple = n-n relationship (with pivot table) |
|
39 | 39 | 'label' => __('Grade Types'), |
40 | 40 | 'type' => 'select2_multiple', |
41 | 41 | 'name' => 'gradeTypes', // the method that defines the relationship in your Model |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | 'select_all' => true, // show Select All and Clear buttons? |
49 | 49 | ]); |
50 | 50 | |
51 | - CRUD::addField([ // Select2Multiple = n-n relationship (with pivot table) |
|
51 | + CRUD::addField([// Select2Multiple = n-n relationship (with pivot table) |
|
52 | 52 | 'label' => __('Skills'), |
53 | 53 | 'type' => 'select2_multiple', |
54 | 54 | 'name' => 'skills', // the method that defines the relationship in your Model |