@@ -61,7 +61,7 @@ |
||
61 | 61 | */ |
62 | 62 | public function verifyEmployee(Employee $employee) |
63 | 63 | { |
64 | - $group = $this->groupsManaged()->whereHas('employees',function ($query) use ($employee) {$query->where('employees.id', $employee->id);})->first(); |
|
64 | + $group = $this->groupsManaged()->whereHas('employees', function($query) use ($employee) {$query->where('employees.id', $employee->id); })->first(); |
|
65 | 65 | |
66 | 66 | return (is_object($group) && $group->exists); |
67 | 67 | } |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function __construct() |
23 | 23 | { |
24 | - config(['auth.model' => \plunner\Company::class]); |
|
25 | - config(['jwt.user' => \plunner\Company::class]); |
|
24 | + config([ 'auth.model' => \plunner\Company::class ]); |
|
25 | + config([ 'jwt.user' => \plunner\Company::class ]); |
|
26 | 26 | $this->middleware('jwt.authandrefresh:mode-cn'); |
27 | 27 | } |
28 | 28 | |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | // |
54 | 54 | $company = \Auth::user(); |
55 | 55 | $input = $request->all(); |
56 | - if(isset($input['password'])) |
|
57 | - $input['password'] = bcrypt($input['password']); |
|
56 | + if (isset($input[ 'password' ])) |
|
57 | + $input[ 'password' ] = bcrypt($input[ 'password' ]); |
|
58 | 58 | $employee = $company->employees()->create($input); |
59 | 59 | return $employee; |
60 | 60 | } |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | $employee = Employee::findOrFail($id); |
87 | 87 | $this->authorize($employee); |
88 | 88 | $input = $request->all(); |
89 | - if(isset($input['password'])) |
|
90 | - $input['password'] = bcrypt($input['password']); |
|
89 | + if (isset($input[ 'password' ])) |
|
90 | + $input[ 'password' ] = bcrypt($input[ 'password' ]); |
|
91 | 91 | $employee->update($input); |
92 | 92 | return $employee; |
93 | 93 | } |
@@ -53,8 +53,9 @@ discard block |
||
53 | 53 | // |
54 | 54 | $company = \Auth::user(); |
55 | 55 | $input = $request->all(); |
56 | - if(isset($input['password'])) |
|
57 | - $input['password'] = bcrypt($input['password']); |
|
56 | + if(isset($input['password'])) { |
|
57 | + $input['password'] = bcrypt($input['password']); |
|
58 | + } |
|
58 | 59 | $employee = $company->employees()->create($input); |
59 | 60 | return $employee; |
60 | 61 | } |
@@ -86,8 +87,9 @@ discard block |
||
86 | 87 | $employee = Employee::findOrFail($id); |
87 | 88 | $this->authorize($employee); |
88 | 89 | $input = $request->all(); |
89 | - if(isset($input['password'])) |
|
90 | - $input['password'] = bcrypt($input['password']); |
|
90 | + if(isset($input['password'])) { |
|
91 | + $input['password'] = bcrypt($input['password']); |
|
92 | + } |
|
91 | 93 | $employee->update($input); |
92 | 94 | return $employee; |
93 | 95 | } |