@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | { |
11 | 11 | public function __construct() |
12 | 12 | { |
13 | - config(['auth.model' => \plunner\Employee::class]); |
|
14 | - config(['jwt.user' => \plunner\Employee::class]); |
|
13 | + config([ 'auth.model' => \plunner\Employee::class ]); |
|
14 | + config([ 'jwt.user' => \plunner\Employee::class ]); |
|
15 | 15 | $this->middleware('jwt.authandrefresh:mode-en'); |
16 | 16 | } |
17 | 17 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | public function update(EmployeeRequest $request) |
37 | 37 | { |
38 | 38 | $employee = \Auth::user(); |
39 | - $input = $request->only(['name', 'password']); |
|
39 | + $input = $request->only([ 'name', 'password' ]); |
|
40 | 40 | $employee->update($input); |
41 | 41 | return $employee; |
42 | 42 | } |
@@ -50,19 +50,19 @@ 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 | * @var array |
64 | 64 | */ |
65 | - protected $appends = ['is_planner']; |
|
65 | + protected $appends = [ 'is_planner' ]; |
|
66 | 66 | |
67 | 67 | public function getIsPlannerAttribute() |
68 | 68 | { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * to get all meetings where the user can go user groups with meetings |
99 | 99 | * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany |
100 | 100 | */ |
101 | - public function meetings(){ |
|
101 | + public function meetings() { |
|
102 | 102 | //TODO durign the inserting chek if the meeting is of a group of the user |
103 | 103 | return $this->belongsToMany(Meeting::class); |
104 | 104 | } |
@@ -114,16 +114,16 @@ discard block |
||
114 | 114 | public function getEmailForPasswordReset() |
115 | 115 | { |
116 | 116 | list(, $caller) = debug_backtrace(false); |
117 | - if(isset($caller['class'])) |
|
118 | - $caller = explode('\\', $caller['class']); |
|
117 | + if (isset($caller[ 'class' ])) |
|
118 | + $caller = explode('\\', $caller[ 'class' ]); |
|
119 | 119 | else |
120 | 120 | $caller = ''; |
121 | 121 | |
122 | 122 | //check if this function is called by email sender |
123 | - if ((count($caller) && $caller[count($caller) - 1] == 'PasswordBroker') || (defined('HHVM_VERSION') && $caller == '')) |
|
123 | + if ((count($caller) && $caller[ count($caller) - 1 ] == 'PasswordBroker') || (defined('HHVM_VERSION') && $caller == '')) |
|
124 | 124 | return $this->email; |
125 | 125 | //return unique identify for token repository |
126 | - return $this->email . $this->company->id; |
|
126 | + return $this->email.$this->company->id; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public function __construct() |
18 | 18 | { |
19 | - config(['auth.model' => \plunner\Employee::class]); |
|
20 | - config(['jwt.user' => \plunner\Employee::class]); |
|
19 | + config([ 'auth.model' => \plunner\Employee::class ]); |
|
20 | + config([ 'jwt.user' => \plunner\Employee::class ]); |
|
21 | 21 | $this->middleware('jwt.authandrefresh:mode-en'); |
22 | 22 | } |
23 | 23 | |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | public function index() |
30 | 30 | { |
31 | 31 | $employee = \Auth::user(); |
32 | - return $employee->groups()->with(['meetings'=>function($query) { |
|
32 | + return $employee->groups()->with([ 'meetings'=>function($query) { |
|
33 | 33 | $query->where('start_time', '=', NULL); |
34 | - }])->get(); |
|
34 | + } ])->get(); |
|
35 | 35 | //TODO get only current meetings |
36 | 36 | } |
37 | 37 |
@@ -17,8 +17,8 @@ |
||
17 | 17 | */ |
18 | 18 | public function __construct() |
19 | 19 | { |
20 | - config(['auth.model' => \plunner\Planner::class]); |
|
21 | - config(['jwt.user' => \plunner\Planner::class]); |
|
20 | + config([ 'auth.model' => \plunner\Planner::class ]); |
|
21 | + config([ 'jwt.user' => \plunner\Planner::class ]); |
|
22 | 22 | $this->middleware('jwt.authandrefresh:mode-en'); |
23 | 23 | } |
24 | 24 |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public function __construct() |
22 | 22 | { |
23 | - config(['auth.model' => \plunner\Planner::class]); |
|
24 | - config(['jwt.user' => \plunner\Planner::class]); |
|
23 | + config([ 'auth.model' => \plunner\Planner::class ]); |
|
24 | + config([ 'jwt.user' => \plunner\Planner::class ]); |
|
25 | 25 | $this->middleware('jwt.authandrefresh:mode-en'); |
26 | 26 | } |
27 | 27 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | if ($meeting->group_id == $groupId) |
41 | 41 | return $meeting->timeslots; |
42 | - return Response::json(['error' => 'meeting->group_id <> groupId'], 403); |
|
42 | + return Response::json([ 'error' => 'meeting->group_id <> groupId' ], 403); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | if ($meeting->group_id == $groupId && $timeslot->meeting_id == $meetingId) |
63 | 63 | return $timeslot; |
64 | - return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403); |
|
64 | + return Response::json([ 'error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId' ], 403); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $timeslot = $meeting->timeslots()->create($input); |
84 | 84 | return $timeslot; |
85 | 85 | } |
86 | - return Response::json(['error' => 'meeting->group_id <> groupId'], 403); |
|
86 | + return Response::json([ 'error' => 'meeting->group_id <> groupId' ], 403); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $timeslot->update($input); |
108 | 108 | return $timeslot; |
109 | 109 | } |
110 | - return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403); |
|
110 | + return Response::json([ 'error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId' ], 403); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -131,6 +131,6 @@ discard block |
||
131 | 131 | $timeslot->delete(); |
132 | 132 | return $timeslot; |
133 | 133 | } |
134 | - return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403); |
|
134 | + return Response::json([ 'error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId' ], 403); |
|
135 | 135 | } |
136 | 136 | } |
@@ -32,14 +32,14 @@ |
||
32 | 32 | * |
33 | 33 | * @var array |
34 | 34 | */ |
35 | - protected $fillable = ['time_start', 'time_end']; |
|
35 | + protected $fillable = [ 'time_start', 'time_end' ]; |
|
36 | 36 | |
37 | 37 | /** |
38 | 38 | * The attributes excluded from the model's JSON form. |
39 | 39 | * |
40 | 40 | * @var array |
41 | 41 | */ |
42 | - protected $hidden = ['pivot', 'meeting']; |
|
42 | + protected $hidden = [ 'pivot', 'meeting' ]; |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | */ |
18 | 18 | public function __construct() |
19 | 19 | { |
20 | - config(['auth.model' => \plunner\Employee::class]); |
|
21 | - config(['jwt.user' => \plunner\Employee::class]); |
|
20 | + config([ 'auth.model' => \plunner\Employee::class ]); |
|
21 | + config([ 'jwt.user' => \plunner\Employee::class ]); |
|
22 | 22 | $this->middleware('jwt.authandrefresh:mode-en'); |
23 | 23 | } |
24 | 24 | |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | $employee = \Auth::user(); |
68 | 68 | $input = $request->all(); |
69 | 69 | $calendar = $employee->calendars()->create($input); |
70 | - if(isset($input['password'])) |
|
71 | - $input['password'] = \Crypt::encrypt($input['password']); |
|
70 | + if (isset($input[ 'password' ])) |
|
71 | + $input[ 'password' ] = \Crypt::encrypt($input[ 'password' ]); |
|
72 | 72 | $calendar->caldav()->create($input); |
73 | 73 | //TODO test |
74 | 74 | //TODO validator |
@@ -105,17 +105,17 @@ discard block |
||
105 | 105 | $this->authorize($calendar); |
106 | 106 | $input = $request->all(); |
107 | 107 | $caldav = $calendar->caldav; |
108 | - if($caldav){ |
|
108 | + if ($caldav) { |
|
109 | 109 | $this->validateCaldav($request); |
110 | 110 | } |
111 | - if(isset($input['password'])) |
|
112 | - $input['password'] = \Crypt::encrypt($input['password']); |
|
111 | + if (isset($input[ 'password' ])) |
|
112 | + $input[ 'password' ] = \Crypt::encrypt($input[ 'password' ]); |
|
113 | 113 | $calendar->update($input); |
114 | 114 | //TODO test |
115 | 115 | //TODO validator |
116 | 116 | //TODO check if caldav exists? |
117 | 117 | |
118 | - if($caldav) |
|
118 | + if ($caldav) |
|
119 | 119 | $caldav->update($input); |
120 | 120 | return $calendar; |
121 | 121 | } |
@@ -149,9 +149,9 @@ discard block |
||
149 | 149 | $caldavClient->connect($request->input('url'), $request->input('username'), $request->input('password')); |
150 | 150 | $calendars = $caldavClient->findCalendars(); |
151 | 151 | return array_keys($calendars); |
152 | - }catch (\it\thecsea\caldav_client_adapter\CaldavException $e) |
|
152 | + } catch (\it\thecsea\caldav_client_adapter\CaldavException $e) |
|
153 | 153 | { |
154 | - return Response::json(['error' => $e->getMessage()],422); |
|
154 | + return Response::json([ 'error' => $e->getMessage() ], 422); |
|
155 | 155 | } |
156 | 156 | } |
157 | 157 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $this->validate($request, [ |
164 | 164 | 'url' => 'required|max:255', |
165 | 165 | 'username' => 'required|max:255', |
166 | - 'password' => ((\Route::current()->getName() == 'employees.calendars.caldav')?'':'sometimes|'). 'required', |
|
166 | + 'password' => ((\Route::current()->getName() == 'employees.calendars.caldav') ? '' : 'sometimes|').'required', |
|
167 | 167 | 'calendar_name' => 'required|max:255', |
168 | 168 | ]); |
169 | 169 | } |
@@ -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 |
@@ -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 |