@@ -79,17 +79,17 @@ |
||
79 | 79 | |
80 | 80 | public function getTotalPriceAttribute($value) |
81 | 81 | { |
82 | - return ($value * $this->quantity )/ 100; |
|
82 | + return ($value * $this->quantity) / 100; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | public function getPriceWithCurrencyAttribute() |
86 | 86 | { |
87 | 87 | if (config('app.currency_position') === 'before') |
88 | 88 | { |
89 | - return config('app.currency_symbol') . " ". $this->price; |
|
89 | + return config('app.currency_symbol')." ".$this->price; |
|
90 | 90 | } |
91 | 91 | |
92 | - return $this->price . " " . config('app.currency_symbol'); |
|
92 | + return $this->price." ".config('app.currency_symbol'); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /* |
@@ -142,10 +142,10 @@ |
||
142 | 142 | { |
143 | 143 | if (config('app.currency_position') === 'before') |
144 | 144 | { |
145 | - return config('app.currency_symbol') . " ". $this->value; |
|
145 | + return config('app.currency_symbol')." ".$this->value; |
|
146 | 146 | } |
147 | 147 | |
148 | - return $this->value . " " . config('app.currency_symbol'); |
|
148 | + return $this->value." ".config('app.currency_symbol'); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | public function getDisplayStatusAttribute() |
@@ -107,7 +107,7 @@ |
||
107 | 107 | { |
108 | 108 | parent::boot(); |
109 | 109 | |
110 | - static::addGlobalScope('external', function (Builder $builder) { |
|
110 | + static::addGlobalScope('external', function(Builder $builder) { |
|
111 | 111 | $builder->where('campus_id', 2); |
112 | 112 | }); |
113 | 113 | } |
@@ -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 | }); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | public function teacher(Request $request) |
48 | 48 | { |
49 | - if (! backpack_user()->isTeacher()) { |
|
49 | + if (!backpack_user()->isTeacher()) { |
|
50 | 50 | abort(403); |
51 | 51 | } |
52 | 52 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | public function student() |
72 | 72 | { |
73 | - if (! backpack_user()->isStudent()) { |
|
73 | + if (!backpack_user()->isStudent()) { |
|
74 | 74 | abort(403); |
75 | 75 | } |
76 | 76 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $currentPeriod = Period::get_default_period(); |
89 | 89 | $enrollmentsPeriod = Period::get_enrollments_period(); |
90 | 90 | |
91 | - if (! backpack_user()->hasRole(['admin', 'secretary'])) { |
|
91 | + if (!backpack_user()->hasRole(['admin', 'secretary'])) { |
|
92 | 92 | abort(403); |
93 | 93 | } |
94 | 94 | |
@@ -99,14 +99,14 @@ discard block |
||
99 | 99 | |
100 | 100 | $teachers = Teacher::with('user')->get()->toArray(); |
101 | 101 | |
102 | - $teachers = array_map(function ($teacher) { |
|
102 | + $teachers = array_map(function($teacher) { |
|
103 | 103 | return [ |
104 | 104 | 'id' => $teacher['id'], |
105 | 105 | 'title' => $teacher['user']['firstname'], |
106 | 106 | ]; |
107 | 107 | }, $teachers); |
108 | 108 | |
109 | - $events = array_map(function ($event) { |
|
109 | + $events = array_map(function($event) { |
|
110 | 110 | return [ |
111 | 111 | 'title' => $event['name'], |
112 | 112 | 'resourceId' => $event['teacher_id'], |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | $username_parts = array_filter(explode(" ", strtolower($fullName))); |
31 | 31 | $username_parts = array_slice($username_parts, -2); |
32 | 32 | |
33 | - $part1 = (!empty($username_parts[0]))?substr($username_parts[0], 0,3):""; |
|
34 | - $part2 = (!empty($username_parts[1]))?substr($username_parts[1], 0,8):""; |
|
33 | + $part1 = (!empty($username_parts[0])) ?substr($username_parts[0], 0, 3) : ""; |
|
34 | + $part2 = (!empty($username_parts[1])) ?substr($username_parts[1], 0, 8) : ""; |
|
35 | 35 | $part3 = rand(999, 9999); |
36 | 36 | |
37 | - $username = $part1. $part2. $part3; //str_shuffle to randomly shuffle all characters |
|
37 | + $username = $part1.$part2.$part3; //str_shuffle to randomly shuffle all characters |
|
38 | 38 | |
39 | 39 | return $username; |
40 | 40 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $username = $data['email']; |
84 | 84 | } |
85 | 85 | else { |
86 | - $username = $this->generateUsername($data['firstname'] . ' ' . $data['lastname']); |
|
86 | + $username = $this->generateUsername($data['firstname'].' '.$data['lastname']); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | // create the user |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | { |
124 | 124 | |
125 | 125 | // if registration is closed, deny access |
126 | - if (! config('backpack.base.registration_open')) { |
|
126 | + if (!config('backpack.base.registration_open')) { |
|
127 | 127 | abort(403, trans('backpack::base.registration_closed')); |
128 | 128 | } |
129 | 129 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | Log::info('Profession and institution added to the student profile'); |
168 | 168 | |
169 | 169 | // add photo |
170 | - if($request->data['userPicture']) { |
|
170 | + if ($request->data['userPicture']) { |
|
171 | 171 | $student |
172 | 172 | ->addMediaFromBase64($request->data['userPicture']) |
173 | 173 | ->usingFileName('profilePicture.jpg') |
@@ -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); |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | 'attribute' => 'lastname', // foreign key attribute that is shown to user |
49 | 49 | 'model' => 'App\Models\User', // foreign key model |
50 | 50 | 'orderable' => true, |
51 | - 'orderLogic' => function ($query, $column, $columnDirection) { |
|
51 | + 'orderLogic' => function($query, $column, $columnDirection) { |
|
52 | 52 | return $query->leftJoin('users', 'users.id', '=', 'students.id') |
53 | 53 | ->orderBy('users.lastname', $columnDirection)->select('students.*'); |
54 | 54 | }, |
55 | - 'searchLogic' => function ($query, $column, $searchTerm) { |
|
56 | - $query->orWhereHas('user', function ($q) use ($searchTerm) { |
|
55 | + 'searchLogic' => function($query, $column, $searchTerm) { |
|
56 | + $query->orWhereHas('user', function($q) use ($searchTerm) { |
|
57 | 57 | $q->where('lastname', 'like', '%'.$searchTerm.'%'); |
58 | 58 | }); |
59 | 59 | }, |
@@ -68,12 +68,12 @@ discard block |
||
68 | 68 | 'attribute' => 'firstname', // foreign key attribute that is shown to user |
69 | 69 | 'model' => 'App\Models\User', // foreign key model |
70 | 70 | 'orderable' => true, |
71 | - 'orderLogic' => function ($query, $column, $columnDirection) { |
|
71 | + 'orderLogic' => function($query, $column, $columnDirection) { |
|
72 | 72 | return $query->leftJoin('users', 'users.id', '=', 'teachers.id') |
73 | 73 | ->orderBy('users.firstname', $columnDirection)->select('teachers.*'); |
74 | 74 | }, |
75 | - 'searchLogic' => function ($query, $column, $searchTerm) { |
|
76 | - $query->orWhereHas('user', function ($q) use ($searchTerm) { |
|
75 | + 'searchLogic' => function($query, $column, $searchTerm) { |
|
76 | + $query->orWhereHas('user', function($q) use ($searchTerm) { |
|
77 | 77 | $q->where('firstname', 'like', '%'.$searchTerm.'%'); |
78 | 78 | }); |
79 | 79 | }, |
@@ -87,12 +87,12 @@ discard block |
||
87 | 87 | 'attribute' => 'email', // foreign key attribute that is shown to user |
88 | 88 | 'model' => 'App\Models\User', // foreign key model |
89 | 89 | 'orderable' => true, |
90 | - 'orderLogic' => function ($query, $column, $columnDirection) { |
|
90 | + 'orderLogic' => function($query, $column, $columnDirection) { |
|
91 | 91 | return $query->leftJoin('users', 'users.id', '=', 'teachers.id') |
92 | 92 | ->orderBy('users.email', $columnDirection)->select('teachers.*'); |
93 | 93 | }, |
94 | - 'searchLogic' => function ($query, $column, $searchTerm) { |
|
95 | - $query->orWhereHas('user', function ($q) use ($searchTerm) { |
|
94 | + 'searchLogic' => function($query, $column, $searchTerm) { |
|
95 | + $query->orWhereHas('user', function($q) use ($searchTerm) { |
|
96 | 96 | $q->where('email', 'like', '%'.$searchTerm.'%'); |
97 | 97 | }); |
98 | 98 | }, |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $username = $request->email; |
167 | 167 | } |
168 | 168 | else { |
169 | - $username = $this->generateUsername($request->firstname . ' ' . $request->lastname); |
|
169 | + $username = $this->generateUsername($request->firstname.' '.$request->lastname); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | $user = User::create([ |
@@ -191,11 +191,11 @@ discard block |
||
191 | 191 | $username_parts = array_filter(explode(" ", strtolower($fullName))); |
192 | 192 | $username_parts = array_slice($username_parts, -2); |
193 | 193 | |
194 | - $part1 = (!empty($username_parts[0]))?substr($username_parts[0], 0,3):""; |
|
195 | - $part2 = (!empty($username_parts[1]))?substr($username_parts[1], 0,8):""; |
|
194 | + $part1 = (!empty($username_parts[0])) ?substr($username_parts[0], 0, 3) : ""; |
|
195 | + $part2 = (!empty($username_parts[1])) ?substr($username_parts[1], 0, 8) : ""; |
|
196 | 196 | $part3 = rand(999, 9999); |
197 | 197 | |
198 | - $username = $part1. $part2. $part3; //str_shuffle to randomly shuffle all characters |
|
198 | + $username = $part1.$part2.$part3; //str_shuffle to randomly shuffle all characters |
|
199 | 199 | |
200 | 200 | return $username; |
201 | 201 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | public function setup() |
28 | 28 | { |
29 | 29 | CRUD::setModel(\App\Models\Config::class); |
30 | - CRUD::setRoute(config('backpack.base.route_prefix') . '/config'); |
|
30 | + CRUD::setRoute(config('backpack.base.route_prefix').'/config'); |
|
31 | 31 | CRUD::setEntityNameStrings('config', 'configs'); |
32 | 32 | } |
33 | 33 |