@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | |
48 | 48 | private function processEmailList($emailList, $duty) |
49 | 49 | { |
50 | - foreach($emailList as $usersDateArray) { |
|
51 | - if ($usersDateArray['date'] == Carbon::today()->format('Y-m-d')){ |
|
50 | + foreach ($emailList as $usersDateArray) { |
|
51 | + if ($usersDateArray['date'] == Carbon::today()->format('Y-m-d')) { |
|
52 | 52 | foreach ($usersDateArray['users'] as $user) { |
53 | 53 | $this->sendTodaysNotification($user, $duty); |
54 | 54 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | Mail::send('emails.duty_today', [ |
72 | 72 | 'user' => $user, |
73 | 73 | 'duty' => $duty |
74 | - ], function ($m) use ($user, $duty) { |
|
74 | + ], function($m) use ($user, $duty) { |
|
75 | 75 | $m->to($user->email, $user->userFullName) |
76 | 76 | ->subject('Reminder: You have ' . $duty->name . ' security check today.'); |
77 | 77 | }); |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | 'user' => $user, |
85 | 85 | 'date' => $date, |
86 | 86 | 'duty' => $duty |
87 | - ], function ($m) use ($user, $duty, $date) { |
|
87 | + ], function($m) use ($user, $duty, $date) { |
|
88 | 88 | |
89 | - $filename = $this->generateICS($duty, Carbon::createFromFormat('Y-m-d',$date)); |
|
89 | + $filename = $this->generateICS($duty, Carbon::createFromFormat('Y-m-d', $date)); |
|
90 | 90 | |
91 | 91 | if ($duty->cycle = 'daily') { |
92 | 92 | $subject = "You have $duty->name security check on $date."; |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | */ |
107 | 107 | private function isReadyForNotification($duty, $usersDateArray) |
108 | 108 | { |
109 | - return ( $duty->cycle == 'weekly' && $usersDateArray['date'] == Carbon::today()->addWeeks(2)->format('Y-m-d') ) |
|
110 | - || ( $duty->cycle == 'daily' && $usersDateArray['date'] == Carbon::today()->addWeeks(1)->format('Y-m-d') ); |
|
109 | + return ($duty->cycle == 'weekly' && $usersDateArray['date'] == Carbon::today()->addWeeks(2)->format('Y-m-d')) |
|
110 | + || ($duty->cycle == 'daily' && $usersDateArray['date'] == Carbon::today()->addWeeks(1)->format('Y-m-d')); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -70,16 +70,16 @@ |
||
70 | 70 | |
71 | 71 | $newNotes = new Collection(); |
72 | 72 | |
73 | - $this->trainingUsers->each( function( $item, $key ) use ($supervisor, $newNotes) { |
|
74 | - if ( $item->user->supervisor_id == $supervisor->id ) { |
|
73 | + $this->trainingUsers->each(function($item, $key) use ($supervisor, $newNotes) { |
|
74 | + if ($item->user->supervisor_id == $supervisor->id) { |
|
75 | 75 | $newNotes->push($item); |
76 | 76 | } |
77 | 77 | }); |
78 | 78 | |
79 | 79 | if (!$newNotes->isEmpty()) { |
80 | - Mail::send('emails.supervisor_reminder', ['notes' => $newNotes], function ($m) use ($supervisor) { |
|
80 | + Mail::send('emails.supervisor_reminder', ['notes' => $newNotes], function($m) use ($supervisor) { |
|
81 | 81 | $m->to($supervisor->email, $supervisor->userFullName) |
82 | - ->subject($supervisor->email.' Training that your employees need to complete.'); |
|
82 | + ->subject($supervisor->email . ' Training that your employees need to complete.'); |
|
83 | 83 | }); |
84 | 84 | } |
85 | 85 |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | |
67 | 67 | //update end of day list for both building and lab. Retrieve list |
68 | 68 | $duties = Duty::all(); |
69 | - $this->dutyLists = $duties->map(function ($item, $key) { |
|
69 | + $this->dutyLists = $duties->map(function($item, $key) { |
|
70 | 70 | $userDateArray = (new DutyList($item))->emailOutput(); |
71 | - $userDateArray->put('duty',$item); |
|
71 | + $userDateArray->put('duty', $item); |
|
72 | 72 | return $userDateArray; |
73 | 73 | }); |
74 | 74 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | 'monday' => Carbon::now()->startOfWeek(), |
94 | 94 | 'dutyLists' => $this->dutyLists, |
95 | 95 | 'destroyed' => $this->destroyed, |
96 | - ], function ($m) use ($reportAddress) { |
|
96 | + ], function($m) use ($reportAddress) { |
|
97 | 97 | $m->to($reportAddress->secondary, $reportAddress->primary) |
98 | 98 | ->subject('Weekly Report'); |
99 | 99 | }); |
@@ -56,14 +56,14 @@ |
||
56 | 56 | |
57 | 57 | public function setDestroyed() |
58 | 58 | { |
59 | - $deadmanList = User::where(function ($q) { |
|
59 | + $deadmanList = User::where(function($q) { |
|
60 | 60 | $q->where('status', 'separated')->orWhere('status', 'destroyed'); |
61 | 61 | }) |
62 | - ->whereBetween('destroyed_date', [Carbon::today(),Carbon::today()->addDays(6)]) |
|
62 | + ->whereBetween('destroyed_date', [Carbon::today(), Carbon::today()->addDays(6)]) |
|
63 | 63 | ->get(); |
64 | 64 | |
65 | 65 | foreach ($deadmanList as $user) { |
66 | - Storage::deleteDirectory('user_'.$user->id); |
|
66 | + Storage::deleteDirectory('user_' . $user->id); |
|
67 | 67 | $user->delete(); |
68 | 68 | } |
69 | 69 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $this->authorize('view'); |
31 | 31 | |
32 | 32 | $groups = Group::with([ |
33 | - 'users' => function ($q) { |
|
33 | + 'users' => function($q) { |
|
34 | 34 | $q->orderBy('last_name'); |
35 | 35 | }, |
36 | 36 | 'trainings' |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | return "nothing sent."; |
123 | 123 | } |
124 | 124 | |
125 | - return User::whereHas('groups', function ($query) use ($request) { |
|
125 | + return User::whereHas('groups', function($query) use ($request) { |
|
126 | 126 | $query->whereIn('id', $request['groups']); |
127 | 127 | })->pluck('id'); |
128 | 128 | } |
@@ -115,7 +115,7 @@ |
||
115 | 115 | { |
116 | 116 | $this->authorize('edit'); |
117 | 117 | |
118 | - Storage::deleteDirectory('news_'.$news->id); |
|
118 | + Storage::deleteDirectory('news_' . $news->id); |
|
119 | 119 | $news->delete(); |
120 | 120 | } |
121 | 121 |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | |
23 | 23 | $encrypt = false; |
24 | 24 | |
25 | - if( array_key_exists('encrypt', $data)) { |
|
25 | + if (array_key_exists('encrypt', $data)) { |
|
26 | 26 | $encrypt = $data['encrypt']; |
27 | 27 | } |
28 | 28 | |
29 | - if ($data['type'] == 'training'){ |
|
29 | + if ($data['type'] == 'training') { |
|
30 | 30 | $model = Training::findOrFail($data['id']); |
31 | 31 | } else if ($data['type'] == 'user') { |
32 | 32 | $model = User::findOrFail($data['id']); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | $file = $modelName . "_" . $entry->imageable_id . '/' . $entry->filename; |
58 | 58 | |
59 | - if($entry->encrypted) { |
|
59 | + if ($entry->encrypted) { |
|
60 | 60 | try { |
61 | 61 | $fileContent = decrypt(Storage::get($file)); |
62 | 62 | } catch (DecryptException $e) { |
@@ -30,9 +30,9 @@ |
||
30 | 30 | $data = $request->all(); |
31 | 31 | $duty = Duty::create($data); |
32 | 32 | |
33 | - if ( isset($data['has_groups']) && isset($data['groups'])) { |
|
33 | + if (isset($data['has_groups']) && isset($data['groups'])) { |
|
34 | 34 | $duty->groups()->attach($data['groups']); |
35 | - } else if( isset($data['users'])) { |
|
35 | + } else if (isset($data['users'])) { |
|
36 | 36 | $duty->users()->attach($data['users']); |
37 | 37 | } |
38 | 38 |
@@ -62,7 +62,7 @@ |
||
62 | 62 | { |
63 | 63 | |
64 | 64 | Note::find($noteId)->delete(); |
65 | - Storage::deleteDirectory('note_'.$noteId); |
|
65 | + Storage::deleteDirectory('note_' . $noteId); |
|
66 | 66 | |
67 | 67 | return back(); |
68 | 68 | } |