| @@ -37,7 +37,7 @@ | ||
| 37 | 37 | */ | 
| 38 | 38 | public function map(Router $router) | 
| 39 | 39 |      { | 
| 40 | -        $router->group(['namespace' => $this->namespace], function ($router) { | |
| 40 | +        $router->group([ 'namespace' => $this->namespace ], function($router) { | |
| 41 | 41 |              require app_path('Http/routes.php'); | 
| 42 | 42 | }); | 
| 43 | 43 | } | 
| @@ -20,8 +20,8 @@ | ||
| 20 | 20 | */ | 
| 21 | 21 | public function __construct() | 
| 22 | 22 |      { | 
| 23 | - config(['auth.model' => \plunner\Company::class]); | |
| 24 | - config(['jwt.user' => \plunner\Company::class]); | |
| 23 | + config([ 'auth.model' => \plunner\Company::class ]); | |
| 24 | + config([ 'jwt.user' => \plunner\Company::class ]); | |
| 25 | 25 |          $this->middleware('jwt.authandrefresh:mode-cn'); | 
| 26 | 26 | } | 
| 27 | 27 | |
| @@ -11,7 +11,7 @@ | ||
| 11 | 11 | * | 
| 12 | 12 | * @var array | 
| 13 | 13 | */ | 
| 14 | - protected $fillable = ['time_start', 'time_end']; | |
| 14 | + protected $fillable = [ 'time_start', 'time_end' ]; | |
| 15 | 15 | |
| 16 | 16 | public function employees() | 
| 17 | 17 |      { | 
| @@ -51,8 +51,9 @@ | ||
| 51 | 51 | |
| 52 | 52 | public function getPlannerNameAttribute() | 
| 53 | 53 |      { | 
| 54 | - if(is_object($this->planner) && $this->planner->exists) | |
| 55 | - return $this->planner->name; | |
| 54 | +        if(is_object($this->planner) && $this->planner->exists) { | |
| 55 | + return $this->planner->name; | |
| 56 | + } | |
| 56 | 57 | } | 
| 57 | 58 | |
| 58 | 59 | /** | 
| @@ -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 | } | 
| @@ -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,7 +53,7 @@ discard block | ||
| 53 | 53 | // | 
| 54 | 54 | $group = Group::findOrFail($groupId); | 
| 55 | 55 | $this->authorize($group); | 
| 56 | - $id = $request->all()['id']; | |
| 56 | + $id = $request->all()[ 'id' ]; | |
| 57 | 57 | $group->employees()->attach($id); | 
| 58 | 58 | return $group->employees; | 
| 59 | 59 | } | 
| @@ -71,8 +71,8 @@ discard block | ||
| 71 | 71 | $employee = Employee::findOrFail($employeeId); | 
| 72 | 72 | $this->authorize($employee); | 
| 73 | 73 | $group = Group::findOrFail($groupId); | 
| 74 | - if(!$employee->belongsToGroup($group)) | |
| 75 | - return Response::json(['error' => 'employId <> groupId'],404); | |
| 74 | + if (!$employee->belongsToGroup($group)) | |
| 75 | + return Response::json([ 'error' => 'employId <> groupId' ], 404); | |
| 76 | 76 | $employee->groups()->detach($groupId); | 
| 77 | 77 | return $group->employees; | 
| 78 | 78 | } | 
| @@ -71,8 +71,9 @@ | ||
| 71 | 71 | $employee = Employee::findOrFail($employeeId); | 
| 72 | 72 | $this->authorize($employee); | 
| 73 | 73 | $group = Group::findOrFail($groupId); | 
| 74 | - if(!$employee->belongsToGroup($group)) | |
| 75 | - return Response::json(['error' => 'employId <> groupId'],404); | |
| 74 | +        if(!$employee->belongsToGroup($group)) { | |
| 75 | + return Response::json(['error' => 'employId <> groupId'],404); | |
| 76 | + } | |
| 76 | 77 | $employee->groups()->detach($groupId); | 
| 77 | 78 | return $group->employees; | 
| 78 | 79 | } | 
| @@ -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 | } | 
| @@ -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 | |