@@ -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 |
@@ -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 |
@@ -44,21 +44,21 @@ |
||
44 | 44 | * |
45 | 45 | * @var array |
46 | 46 | */ |
47 | - protected $fillable = ['name', 'description', 'planner_id']; |
|
47 | + protected $fillable = [ 'name', 'description', 'planner_id' ]; |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * @var array |
51 | 51 | */ |
52 | - protected $hidden = ['planner', 'pivot']; |
|
52 | + protected $hidden = [ 'planner', 'pivot' ]; |
|
53 | 53 | |
54 | 54 | /** |
55 | 55 | * @var array |
56 | 56 | */ |
57 | - protected $appends = ['planner_name']; |
|
57 | + protected $appends = [ 'planner_name' ]; |
|
58 | 58 | |
59 | 59 | public function getPlannerNameAttribute() |
60 | 60 | { |
61 | - if(is_object($this->planner) && $this->planner->exists) |
|
61 | + if (is_object($this->planner) && $this->planner->exists) |
|
62 | 62 | return $this->planner->name; |
63 | 63 | return null; |
64 | 64 | } |
@@ -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 | } |
@@ -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 | } |
@@ -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 |
@@ -18,8 +18,8 @@ |
||
18 | 18 | */ |
19 | 19 | public function __construct() |
20 | 20 | { |
21 | - config(['auth.model' => Planner::class]); |
|
22 | - config(['jwt.user' => Planner::class]); |
|
21 | + config([ 'auth.model' => Planner::class ]); |
|
22 | + config([ 'jwt.user' => Planner::class ]); |
|
23 | 23 | $this->middleware('jwt.authandrefresh:mode-en'); |
24 | 24 | } |
25 | 25 |
@@ -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 |
@@ -57,14 +57,14 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @var array |
59 | 59 | */ |
60 | - protected $fillable = ['name', 'email', 'password']; |
|
60 | + protected $fillable = [ 'name', 'email', 'password' ]; |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * The attributes excluded from the model's JSON form. |
64 | 64 | * |
65 | 65 | * @var array |
66 | 66 | */ |
67 | - protected $hidden = ['password', 'remember_token', 'pivot']; |
|
67 | + protected $hidden = [ 'password', 'remember_token', 'pivot' ]; |
|
68 | 68 | |
69 | 69 | /** |
70 | 70 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
@@ -109,16 +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']); |
|
112 | + if (isset($caller[ 'class' ])) |
|
113 | + $caller = explode('\\', $caller[ 'class' ]); |
|
114 | 114 | else |
115 | 115 | $caller = ''; |
116 | 116 | |
117 | 117 | //check if this function is called by email sender |
118 | - if ((count($caller) && $caller[count($caller) - 1] == 'PasswordBroker') || (defined('HHVM_VERSION') && $caller == '')) |
|
118 | + if ((count($caller) && $caller[ count($caller) - 1 ] == 'PasswordBroker') || (defined('HHVM_VERSION') && $caller == '')) |
|
119 | 119 | return $this->email; |
120 | 120 | //return unique identify for token repository |
121 | - return $this->email . $this->company->id; |
|
121 | + return $this->email.$this->company->id; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | public function belongsToGroup(Group $group) |
129 | 129 | { |
130 | 130 | $group = $this->groups()->where('id', $group->id)->first(); |
131 | - if(is_object($group) && $group->exists) |
|
131 | + if (is_object($group) && $group->exists) |
|
132 | 132 | return true; |
133 | 133 | return false; |
134 | 134 | } |