@@ -20,14 +20,14 @@ |
||
20 | 20 | parent::boot(); |
21 | 21 | |
22 | 22 | // do not save already existing leaves |
23 | - static::saving(function (self $leave) { |
|
23 | + static::saving(function(self $leave) { |
|
24 | 24 | if (self::where('teacher_id', $leave->teacher_id)->where('date', $leave->date)->count() > 0) { |
25 | 25 | return false; |
26 | 26 | } |
27 | 27 | }); |
28 | 28 | |
29 | 29 | // when a leave is, we detach the events from the teacher |
30 | - static::saved(function (self $leave) { |
|
30 | + static::saved(function(self $leave) { |
|
31 | 31 | $events = Event::where('teacher_id', $leave->teacher_id)->whereDate('start', $leave->date)->get(); |
32 | 32 | foreach ($events as $event) { |
33 | 33 | $event->teacher_id = null; |
@@ -15,12 +15,12 @@ |
||
15 | 15 | parent::boot(); |
16 | 16 | |
17 | 17 | // when a coursetime is added, we should create corresponding events |
18 | - static::created(function ($coursetime) { |
|
18 | + static::created(function($coursetime) { |
|
19 | 19 | $coursetime->create_events(); |
20 | 20 | }); |
21 | 21 | |
22 | 22 | // when a coursetime is deleted, we should delete all associated future events |
23 | - static::deleted(function ($coursetime) { |
|
23 | + static::deleted(function($coursetime) { |
|
24 | 24 | $coursetime->events()->delete(); |
25 | 25 | // todo delete only future events |
26 | 26 | }); |
@@ -56,7 +56,7 @@ |
||
56 | 56 | return $this->respondToUnauthorizedRequest($request); |
57 | 57 | } |
58 | 58 | |
59 | - if (! $this->checkIfUserIsAdmin(backpack_user())) { |
|
59 | + if (!$this->checkIfUserIsAdmin(backpack_user())) { |
|
60 | 60 | return $this->respondToUnauthorizedRequest($request); |
61 | 61 | } |
62 | 62 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | return redirect()->to('login'); |
20 | 20 | } |
21 | 21 | |
22 | - if (! backpack_user()->can($permission)) { |
|
22 | + if (!backpack_user()->can($permission)) { |
|
23 | 23 | abort(403); |
24 | 24 | } |
25 | 25 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | return redirect('/login'); |
20 | 20 | } |
21 | 21 | |
22 | - if (! backpack_auth()->user()->hasRole($role)) { |
|
22 | + if (!backpack_auth()->user()->hasRole($role)) { |
|
23 | 23 | abort(403); |
24 | 24 | } |
25 | 25 |
@@ -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 |
@@ -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 |
@@ -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 |