@@ -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 | } |