@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * cn = company normal |
32 | 32 | * @var array |
33 | 33 | */ |
34 | - protected $custom = ['mode'=>'cn']; |
|
34 | + protected $custom = [ 'mode'=>'cn' ]; |
|
35 | 35 | |
36 | 36 | |
37 | 37 | /** |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function __construct() |
43 | 43 | { |
44 | - config(['auth.model' => \plunner\Company::class]); |
|
45 | - config(['jwt.user' => \plunner\Company::class]); |
|
46 | - config(['auth.password.table' => 'password_resets_companies', 'auth.password.email' => 'emails.companies.password']); |
|
44 | + config([ 'auth.model' => \plunner\Company::class ]); |
|
45 | + config([ 'jwt.user' => \plunner\Company::class ]); |
|
46 | + config([ 'auth.password.table' => 'password_resets_companies', 'auth.password.email' => 'emails.companies.password' ]); |
|
47 | 47 | } |
48 | 48 | } |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | * en = employee normal |
39 | 39 | * @var array |
40 | 40 | */ |
41 | - protected $custom = ['mode'=>'en']; |
|
41 | + protected $custom = [ 'mode'=>'en' ]; |
|
42 | 42 | |
43 | 43 | /** |
44 | 44 | * @var array |
45 | 45 | */ |
46 | - protected $username = ['email', 'company_id']; |
|
46 | + protected $username = [ 'email', 'company_id' ]; |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * @var company |
@@ -57,24 +57,24 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function __construct() |
59 | 59 | { |
60 | - config(['auth.model' => \plunner\Employee::class]); |
|
61 | - config(['jwt.user' => \plunner\Employee::class]); |
|
62 | - config(['auth.password.table' => 'password_resets_employees', 'auth.password.email' => 'emails.employees.password']); |
|
60 | + config([ 'auth.model' => \plunner\Employee::class ]); |
|
61 | + config([ 'jwt.user' => \plunner\Employee::class ]); |
|
62 | + config([ 'auth.password.table' => 'password_resets_employees', 'auth.password.email' => 'emails.employees.password' ]); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | public function postEmail(Request $request) |
66 | 66 | { |
67 | - $this->validate($request, ['company' => 'required|exists:companies,name']); |
|
67 | + $this->validate($request, [ 'company' => 'required|exists:companies,name' ]); |
|
68 | 68 | $this->company = Company::whereName($request->input('company'))->firstOrFail(); |
69 | - $request->merge(['company_id' => $this->company->id]); |
|
69 | + $request->merge([ 'company_id' => $this->company->id ]); |
|
70 | 70 | return $this->postEmailOriginal($request); |
71 | 71 | } |
72 | 72 | |
73 | 73 | public function postReset(Request $request) |
74 | 74 | { |
75 | - $this->validate($request, ['company' => 'required|exists:companies,name']); |
|
75 | + $this->validate($request, [ 'company' => 'required|exists:companies,name' ]); |
|
76 | 76 | $this->company = Company::whereName($request->input('company'))->firstOrFail(); |
77 | - $request->merge(['company_id' => $this->company->id]); |
|
77 | + $request->merge([ 'company_id' => $this->company->id ]); |
|
78 | 78 | return $this->postResetOriginal($request); |
79 | 79 | } |
80 | 80 |
@@ -109,14 +109,16 @@ discard block |
||
109 | 109 | public function getEmailForPasswordReset() |
110 | 110 | { |
111 | 111 | list(, $caller) = debug_backtrace(false); |
112 | - if(isset($caller['class'])) |
|
113 | - $caller = explode('\\', $caller['class']); |
|
114 | - else |
|
115 | - $caller = ''; |
|
112 | + if(isset($caller['class'])) { |
|
113 | + $caller = explode('\\', $caller['class']); |
|
114 | + } else { |
|
115 | + $caller = ''; |
|
116 | + } |
|
116 | 117 | |
117 | 118 | //check if this function is called by email sender |
118 | - if ((count($caller) && $caller[count($caller) - 1] == 'PasswordBroker') || (defined('HHVM_VERSION') && $caller == '')) |
|
119 | - return $this->email; |
|
119 | + if ((count($caller) && $caller[count($caller) - 1] == 'PasswordBroker') || (defined('HHVM_VERSION') && $caller == '')) { |
|
120 | + return $this->email; |
|
121 | + } |
|
120 | 122 | //return unique identify for token repository |
121 | 123 | return $this->email . $this->company->id; |
122 | 124 | } |
@@ -128,8 +130,9 @@ discard block |
||
128 | 130 | public function belongsToGroup(Group $group) |
129 | 131 | { |
130 | 132 | $group = $this->groups()->where('id', $group->id)->first(); |
131 | - if(is_object($group) && $group->exists) |
|
132 | - return true; |
|
133 | + if(is_object($group) && $group->exists) { |
|
134 | + return true; |
|
135 | + } |
|
133 | 136 | return false; |
134 | 137 | } |
135 | 138 |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | * |
51 | 51 | * @var array |
52 | 52 | */ |
53 | - protected $fillable = ['name', 'email', 'password']; |
|
53 | + protected $fillable = [ 'name', 'email', 'password' ]; |
|
54 | 54 | |
55 | 55 | /** |
56 | 56 | * The attributes excluded from the model's JSON form. |
57 | 57 | * |
58 | 58 | * @var array |
59 | 59 | */ |
60 | - protected $hidden = ['password', 'remember_token', 'pivot']; |
|
60 | + protected $hidden = [ 'password', 'remember_token', 'pivot' ]; |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * to get all meetings where the user can go user groups with meetings |
89 | 89 | * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany |
90 | 90 | */ |
91 | - public function meetings(){ |
|
91 | + public function meetings() { |
|
92 | 92 | //TODO durign the inserting chek if the meeting is of a group of the user |
93 | 93 | return $this->belongsToMany(Meeting::class); |
94 | 94 | } |
@@ -104,16 +104,16 @@ discard block |
||
104 | 104 | public function getEmailForPasswordReset() |
105 | 105 | { |
106 | 106 | list(, $caller) = debug_backtrace(false); |
107 | - if(isset($caller['class'])) |
|
108 | - $caller = explode('\\', $caller['class']); |
|
107 | + if (isset($caller[ 'class' ])) |
|
108 | + $caller = explode('\\', $caller[ 'class' ]); |
|
109 | 109 | else |
110 | 110 | $caller = ''; |
111 | 111 | |
112 | 112 | //check if this function is called by email sender |
113 | - if ((count($caller) && $caller[count($caller) - 1] == 'PasswordBroker') || (defined('HHVM_VERSION') && $caller == '')) |
|
113 | + if ((count($caller) && $caller[ count($caller) - 1 ] == 'PasswordBroker') || (defined('HHVM_VERSION') && $caller == '')) |
|
114 | 114 | return $this->email; |
115 | 115 | //return unique identify for token repository |
116 | - return $this->email . $this->company->id; |
|
116 | + return $this->email.$this->company->id; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | public function belongsToGroup(Group $group) |
124 | 124 | { |
125 | 125 | $group = $this->groups()->where('id', $group->id)->first(); |
126 | - if(is_object($group) && $group->exists) |
|
126 | + if (is_object($group) && $group->exists) |
|
127 | 127 | return true; |
128 | 128 | return false; |
129 | 129 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | { |
23 | 23 | |
24 | 24 | // Don't validate CSRF when testing. |
25 | - if(env('APP_ENV') === 'testing') { |
|
25 | + if (env('APP_ENV') === 'testing') { |
|
26 | 26 | return true; |
27 | 27 | } |
28 | 28 |
@@ -34,7 +34,7 @@ |
||
34 | 34 | return [ |
35 | 35 | 'name' => 'required|max:255', |
36 | 36 | 'email' => 'required|email|max:255|unique:employees,email,'.$this->route('employees').',id,company_id,'.$this->user()->id, |
37 | - 'password' => ((\Route::current()->getName() == 'companies.employees.store')?'required|':'').'confirmed|min:6', |
|
37 | + 'password' => ((\Route::current()->getName() == 'companies.employees.store') ? 'required|' : '').'confirmed|min:6', |
|
38 | 38 | ]; |
39 | 39 | } |
40 | 40 | } |
@@ -1,21 +1,21 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Created by PhpStorm. |
|
4 | - * User: Claudio Cardinale <[email protected]> |
|
5 | - * Date: 03/12/15 |
|
6 | - * Time: 2.33 |
|
7 | - * This program is free software; you can redistribute it and/or |
|
8 | - * modify it under the terms of the GNU General Public License |
|
9 | - * as published by the Free Software Foundation; either version 2 |
|
10 | - * of the License, or (at your option) any later version. |
|
11 | - * This program is distributed in the hope that it will be useful, |
|
12 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 | - * GNU General Public License for more details. |
|
15 | - * You should have received a copy of the GNU General Public License |
|
16 | - * along with this program; if not, write to the Free Software |
|
17 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
18 | - */ |
|
3 | + * Created by PhpStorm. |
|
4 | + * User: Claudio Cardinale <[email protected]> |
|
5 | + * Date: 03/12/15 |
|
6 | + * Time: 2.33 |
|
7 | + * This program is free software; you can redistribute it and/or |
|
8 | + * modify it under the terms of the GNU General Public License |
|
9 | + * as published by the Free Software Foundation; either version 2 |
|
10 | + * of the License, or (at your option) any later version. |
|
11 | + * This program is distributed in the hope that it will be useful, |
|
12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 | + * GNU General Public License for more details. |
|
15 | + * You should have received a copy of the GNU General Public License |
|
16 | + * along with this program; if not, write to the Free Software |
|
17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
18 | + */ |
|
19 | 19 | |
20 | 20 | namespace plunner\Console\Commands\SyncCaldav; |
21 | 21 |
@@ -73,12 +73,12 @@ discard block |
||
73 | 73 | $caldavClient = new SimpleCaldavAdapter(); |
74 | 74 | $caldavClient->connect($this->calendar->url, $this->calendar->username, \Crypt::decrypt($this->calendar->password)); |
75 | 75 | $calendars = $caldavClient->findCalendars(); |
76 | - $caldavClient->setCalendar($calendars[$this->calendar->calendar_name]);//TODO error if the calendar name is wrong |
|
76 | + $caldavClient->setCalendar($calendars[ $this->calendar->calendar_name ]); //TODO error if the calendar name is wrong |
|
77 | 77 | /** |
78 | 78 | * 26 hours before to avoid tiemezone problems and dst problems |
79 | 79 | * 30 days after |
80 | 80 | */ |
81 | - return $caldavClient->getEvents(date('Ymd\THis\Z', time()-93600), date('Ymd\THis\Z', time()+2592000)); |
|
81 | + return $caldavClient->getEvents(date('Ymd\THis\Z', time() - 93600), date('Ymd\THis\Z', time() + 2592000)); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -89,13 +89,13 @@ discard block |
||
89 | 89 | try |
90 | 90 | { |
91 | 91 | $events = $this->getEvents(); |
92 | - }catch (\it\thecsea\caldav_client_adapter\CaldavException $e) |
|
92 | + } catch (\it\thecsea\caldav_client_adapter\CaldavException $e) |
|
93 | 93 | { |
94 | 94 | \Event::fire(new CaldavErrorEvent($this->calendar, $e->getMessage())); |
95 | - return ; |
|
96 | - }catch(\Illuminate\Contracts\Encryption\DecryptException $e){ |
|
95 | + return; |
|
96 | + } catch (\Illuminate\Contracts\Encryption\DecryptException $e) { |
|
97 | 97 | \Event::fire(new CaldavErrorEvent($this->calendar, $e->getMessage())); |
98 | - return ; |
|
98 | + return; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | |
106 | 106 | //remove old timeslots |
107 | 107 | $calendarMain->timeslots()->delete(); |
108 | - foreach($events as $event){ |
|
109 | - if(!($event = $this->parseEvent($event))) |
|
108 | + foreach ($events as $event) { |
|
109 | + if (!($event = $this->parseEvent($event))) |
|
110 | 110 | \Event::fire(new CaldavErrorEvent($this->calendar, 'problem during the parsing an event')); |
111 | 111 | else |
112 | 112 | $calendarMain->timeslots()->create($event); |
@@ -120,16 +120,16 @@ discard block |
||
120 | 120 | private function parseEvent(EventInterface $event) |
121 | 121 | { |
122 | 122 | $pattern = "/^((DTSTART;)|(DTEND;))(.*)\$/m"; |
123 | - if(preg_match_all($pattern, $event->getData(), $matches)){ |
|
124 | - if(!isset($matches[4]) || count($matches[4]) != 2) |
|
123 | + if (preg_match_all($pattern, $event->getData(), $matches)) { |
|
124 | + if (!isset($matches[ 4 ]) || count($matches[ 4 ]) != 2) |
|
125 | 125 | return null; |
126 | - $ret = []; |
|
127 | - if($tmp = $this->parseDate($matches[4][0])) |
|
128 | - $ret['time_start'] = $tmp; |
|
126 | + $ret = [ ]; |
|
127 | + if ($tmp = $this->parseDate($matches[ 4 ][ 0 ])) |
|
128 | + $ret[ 'time_start' ] = $tmp; |
|
129 | 129 | else |
130 | 130 | return null; |
131 | - if($tmp = $this->parseDate($matches[4][1])) |
|
132 | - $ret['time_end'] = $tmp; |
|
131 | + if ($tmp = $this->parseDate($matches[ 4 ][ 1 ])) |
|
132 | + $ret[ 'time_end' ] = $tmp; |
|
133 | 133 | else |
134 | 134 | return null; |
135 | 135 | return $ret; |
@@ -144,13 +144,13 @@ discard block |
||
144 | 144 | private function parseDate($date) |
145 | 145 | { |
146 | 146 | $pattern = "/^((TZID=)|(VALUE=))(.*):(.*)\$/m"; |
147 | - if(preg_match_all($pattern, $date, $matches)){ |
|
148 | - if($matches[1][0] == 'TZID=') |
|
147 | + if (preg_match_all($pattern, $date, $matches)) { |
|
148 | + if ($matches[ 1 ][ 0 ] == 'TZID=') |
|
149 | 149 | { |
150 | - return \DateTime::createFromFormat('Ymd\THis', $matches[5][0], new \DateTimeZone($matches[4][0])); |
|
151 | - }else if($matches[1][0] == 'VALUE=' && $matches[4][0] == 'DATE') |
|
150 | + return \DateTime::createFromFormat('Ymd\THis', $matches[ 5 ][ 0 ], new \DateTimeZone($matches[ 4 ][ 0 ])); |
|
151 | + } else if ($matches[ 1 ][ 0 ] == 'VALUE=' && $matches[ 4 ][ 0 ] == 'DATE') |
|
152 | 152 | { |
153 | - return \DateTime::createFromFormat('Ymd\THis', $matches[5][0].'T000000'); |
|
153 | + return \DateTime::createFromFormat('Ymd\THis', $matches[ 5 ][ 0 ].'T000000'); |
|
154 | 154 | } |
155 | 155 | } |
156 | 156 | return null; |
@@ -91,11 +91,11 @@ discard block |
||
91 | 91 | try |
92 | 92 | { |
93 | 93 | $events = $this->getEvents(); |
94 | - }catch (\it\thecsea\caldav_client_adapter\CaldavException $e) |
|
94 | + } catch (\it\thecsea\caldav_client_adapter\CaldavException $e) |
|
95 | 95 | { |
96 | 96 | \Event::fire(new ErrorEvent($this->calendar, $e->getMessage())); |
97 | 97 | return ; |
98 | - }catch(\Illuminate\Contracts\Encryption\DecryptException $e){ |
|
98 | + } catch(\Illuminate\Contracts\Encryption\DecryptException $e){ |
|
99 | 99 | \Event::fire(new ErrorEvent($this->calendar, $e->getMessage())); |
100 | 100 | return ; |
101 | 101 | } |
@@ -110,10 +110,11 @@ discard block |
||
110 | 110 | |
111 | 111 | //insert new timeslots |
112 | 112 | foreach($events as $event){ |
113 | - if(!($event = $this->parseEvent($event))) |
|
114 | - \Event::fire(new ErrorEvent($this->calendar, 'problem during the parsing an event')); |
|
115 | - else |
|
116 | - $calendarMain->timeslots()->create($event); |
|
113 | + if(!($event = $this->parseEvent($event))) { |
|
114 | + \Event::fire(new ErrorEvent($this->calendar, 'problem during the parsing an event')); |
|
115 | + } else { |
|
116 | + $calendarMain->timeslots()->create($event); |
|
117 | + } |
|
117 | 118 | } |
118 | 119 | \Event::fire(new OkEvent($this->calendar)); |
119 | 120 | } |
@@ -126,17 +127,20 @@ discard block |
||
126 | 127 | { |
127 | 128 | $pattern = "/^((DTSTART;)|(DTEND;))(.*)\$/m"; |
128 | 129 | if(preg_match_all($pattern, $event->getData(), $matches)){ |
129 | - if(!isset($matches[4]) || count($matches[4]) != 2) |
|
130 | - return null; |
|
130 | + if(!isset($matches[4]) || count($matches[4]) != 2) { |
|
131 | + return null; |
|
132 | + } |
|
131 | 133 | $ret = []; |
132 | - if($tmp = $this->parseDate($matches[4][0])) |
|
133 | - $ret['time_start'] = $tmp; |
|
134 | - else |
|
135 | - return null; |
|
136 | - if($tmp = $this->parseDate($matches[4][1])) |
|
137 | - $ret['time_end'] = $tmp; |
|
138 | - else |
|
139 | - return null; |
|
134 | + if($tmp = $this->parseDate($matches[4][0])) { |
|
135 | + $ret['time_start'] = $tmp; |
|
136 | + } else { |
|
137 | + return null; |
|
138 | + } |
|
139 | + if($tmp = $this->parseDate($matches[4][1])) { |
|
140 | + $ret['time_end'] = $tmp; |
|
141 | + } else { |
|
142 | + return null; |
|
143 | + } |
|
140 | 144 | return $ret; |
141 | 145 | } |
142 | 146 | return null; |
@@ -153,7 +157,7 @@ discard block |
||
153 | 157 | if($matches[1][0] == 'TZID=') |
154 | 158 | { |
155 | 159 | return \DateTime::createFromFormat('Ymd\THis', $matches[5][0], new \DateTimeZone($matches[4][0])); |
156 | - }else if($matches[1][0] == 'VALUE=' && $matches[4][0] == 'DATE') |
|
160 | + } else if($matches[1][0] == 'VALUE=' && $matches[4][0] == 'DATE') |
|
157 | 161 | { |
158 | 162 | return \DateTime::createFromFormat('Ymd\THis', $matches[5][0].'T000000'); |
159 | 163 | } |
@@ -82,7 +82,7 @@ |
||
82 | 82 | { |
83 | 83 | $event = $this->schedule->command('sync:caldav '.$calendar->calendar_id)->withoutOverlapping(); |
84 | 84 | if($event->isDue($this->laravel)) |
85 | - $event->run($this->laravel); |
|
85 | + $event->run($this->laravel); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | { |
54 | 54 | // |
55 | 55 | $calendarId = $this->argument('calendarId'); |
56 | - if(is_numeric($calendarId)) |
|
56 | + if (is_numeric($calendarId)) |
|
57 | 57 | $this->makeForeground(Caldav::findOrFail($calendarId)); |
58 | 58 | else |
59 | 59 | $this->syncAll(); |
@@ -62,15 +62,15 @@ discard block |
||
62 | 62 | private function syncAll() |
63 | 63 | { |
64 | 64 | $calendars = Caldav::all(); |
65 | - if($this->option('background')) { |
|
65 | + if ($this->option('background')) { |
|
66 | 66 | \Log::debug(self::BACKGROUND_MOD_MEX); |
67 | 67 | $this->info(self::BACKGROUND_MOD_MEX); |
68 | 68 | foreach ($calendars as $calendar) |
69 | 69 | $this->makeBackground($calendar); |
70 | 70 | \Log::debug(self::BACKGROUND_COMPLETED_MEX); |
71 | 71 | $this->info(self::BACKGROUND_COMPLETED_MEX); |
72 | - }else |
|
73 | - foreach($calendars as $calendar) |
|
72 | + } else |
|
73 | + foreach ($calendars as $calendar) |
|
74 | 74 | $this->makeForeground($calendar); |
75 | 75 | } |
76 | 76 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | private function makeBackground(Caldav $calendar) |
82 | 82 | { |
83 | 83 | $event = $this->schedule->command('sync:caldav '.$calendar->calendar_id)->withoutOverlapping(); |
84 | - if($event->isDue($this->laravel)) |
|
84 | + if ($event->isDue($this->laravel)) |
|
85 | 85 | $event->run($this->laravel); |
86 | 86 | } |
87 | 87 | |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | */ |
92 | 92 | private function makeForeground(Caldav $calendar) |
93 | 93 | { |
94 | - $this->info('Sync calendar '. $calendar->calendar_id.' started'); |
|
94 | + $this->info('Sync calendar '.$calendar->calendar_id.' started'); |
|
95 | 95 | (new Sync($calendar))->sync(); |
96 | - $this->info('Sync calendar '. $calendar->calendar_id.' completed'); |
|
96 | + $this->info('Sync calendar '.$calendar->calendar_id.' completed'); |
|
97 | 97 | } |
98 | 98 | } |
@@ -53,10 +53,11 @@ discard block |
||
53 | 53 | { |
54 | 54 | // |
55 | 55 | $calendarId = $this->argument('calendarId'); |
56 | - if(is_numeric($calendarId)) |
|
57 | - $this->makeForeground(Caldav::findOrFail($calendarId)); |
|
58 | - else |
|
59 | - $this->syncAll(); |
|
56 | + if(is_numeric($calendarId)) { |
|
57 | + $this->makeForeground(Caldav::findOrFail($calendarId)); |
|
58 | + } else { |
|
59 | + $this->syncAll(); |
|
60 | + } |
|
60 | 61 | } |
61 | 62 | |
62 | 63 | private function syncAll() |
@@ -65,13 +66,15 @@ discard block |
||
65 | 66 | if($this->option('background')) { |
66 | 67 | \Log::debug(self::BACKGROUND_MOD_MEX); |
67 | 68 | $this->info(self::BACKGROUND_MOD_MEX); |
68 | - foreach ($calendars as $calendar) |
|
69 | - $this->makeBackground($calendar); |
|
69 | + foreach ($calendars as $calendar) { |
|
70 | + $this->makeBackground($calendar); |
|
71 | + } |
|
70 | 72 | \Log::debug(self::BACKGROUND_COMPLETED_MEX); |
71 | 73 | $this->info(self::BACKGROUND_COMPLETED_MEX); |
72 | - }else |
|
73 | - foreach($calendars as $calendar) |
|
74 | + } else { |
|
75 | + foreach($calendars as $calendar) |
|
74 | 76 | $this->makeForeground($calendar); |
77 | + } |
|
75 | 78 | } |
76 | 79 | |
77 | 80 | /** |
@@ -81,8 +84,9 @@ discard block |
||
81 | 84 | private function makeBackground(Caldav $calendar) |
82 | 85 | { |
83 | 86 | $event = $this->schedule->command('sync:caldav '.$calendar->calendar_id)->withoutOverlapping(); |
84 | - if($event->isDue($this->laravel)) |
|
85 | - $event->run($this->laravel); |
|
87 | + if($event->isDue($this->laravel)) { |
|
88 | + $event->run($this->laravel); |
|
89 | + } |
|
86 | 90 | } |
87 | 91 | |
88 | 92 | /** |
@@ -37,19 +37,19 @@ |
||
37 | 37 | /** |
38 | 38 | * @var array |
39 | 39 | */ |
40 | - protected $touches = ['calendar']; |
|
40 | + protected $touches = [ 'calendar' ]; |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * @var array |
44 | 44 | */ |
45 | - protected $fillable = ['url', 'username', 'password', 'calendar_name']; |
|
45 | + protected $fillable = [ 'url', 'username', 'password', 'calendar_name' ]; |
|
46 | 46 | |
47 | 47 | /** |
48 | 48 | * The attributes excluded from the model's JSON form. |
49 | 49 | * |
50 | 50 | * @var array |
51 | 51 | */ |
52 | - protected $hidden = ['password']; |
|
52 | + protected $hidden = [ 'password' ]; |
|
53 | 53 | |
54 | 54 | /** |
55 | 55 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
@@ -2,11 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace plunner\Http\Controllers\Employees; |
4 | 4 | |
5 | -use Illuminate\Http\Request; |
|
6 | - |
|
7 | -use plunner\Group; |
|
8 | 5 | use plunner\Employee; |
9 | -use plunner\Http\Requests; |
|
6 | +use plunner\Group; |
|
10 | 7 | use plunner\Http\Controllers\Controller; |
11 | 8 | |
12 | 9 | class GroupsController extends Controller |
@@ -21,8 +21,8 @@ |
||
21 | 21 | */ |
22 | 22 | public function __construct() |
23 | 23 | { |
24 | - config(['auth.model' => \plunner\Employee::class]); |
|
25 | - config(['jwt.user' => \plunner\Employee::class]); |
|
24 | + config([ 'auth.model' => \plunner\Employee::class ]); |
|
25 | + config([ 'jwt.user' => \plunner\Employee::class ]); |
|
26 | 26 | $this->middleware('jwt.authandrefresh:mode-en'); |
27 | 27 | } |
28 | 28 |