@@ -112,6 +112,9 @@ |
||
112 | 112 | return $this->respondOK(); |
113 | 113 | } |
114 | 114 | |
115 | + /** |
|
116 | + * @param Request $request |
|
117 | + */ |
|
115 | 118 | private function validateGroupUpdates($request) |
116 | 119 | { |
117 | 120 | $this->validate($request, [ |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | $input = $request->all(); |
51 | 51 | |
52 | 52 | $g = Group::create([ |
53 | - 'name' => $input['group_name'], |
|
54 | - 'description' => isset($input['description']) ? $input['description'] : '' |
|
53 | + 'name' => $input[ 'group_name' ], |
|
54 | + 'description' => isset($input[ 'description' ]) ? $input[ 'description' ] : '' |
|
55 | 55 | ]); |
56 | - $employees = Employee::whereIn('name', $input['employees'])->get(); |
|
56 | + $employees = Employee::whereIn('name', $input[ 'employees' ])->get(); |
|
57 | 57 | |
58 | 58 | $g->addEmployees($employees); |
59 | 59 | |
@@ -94,15 +94,15 @@ discard block |
||
94 | 94 | $this->validateGroupUpdates($request); |
95 | 95 | $input = $request->all(); |
96 | 96 | |
97 | - $employees = Employee::whereIn('name', $input['employees'])->get(); |
|
97 | + $employees = Employee::whereIn('name', $input[ 'employees' ])->get(); |
|
98 | 98 | |
99 | 99 | try { |
100 | - $group = Group::findOrFail($input['group_name']); |
|
100 | + $group = Group::findOrFail($input[ 'group_name' ]); |
|
101 | 101 | } catch (ModelNotFoundException $e) { |
102 | 102 | return $this->responder->respond( |
103 | 103 | [ |
104 | 104 | 'message' => 'Group not found', |
105 | - 'group_name' => $input['group_name'] |
|
105 | + 'group_name' => $input[ 'group_name' ] |
|
106 | 106 | ], |
107 | 107 | 404 |
108 | 108 | ); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | private function respondOK() |
124 | 124 | { |
125 | - return $this->responder->respond([], 200); |
|
125 | + return $this->responder->respond([ ], 200); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
@@ -9,8 +9,6 @@ |
||
9 | 9 | |
10 | 10 | namespace Services\ResponseCreator; |
11 | 11 | |
12 | -use Illuminate\Support\ServiceProvider; |
|
13 | - |
|
14 | 12 | class ResponseCreatorBinder |
15 | 13 | { |
16 | 14 | /** |
@@ -22,7 +22,7 @@ |
||
22 | 22 | { |
23 | 23 | $app = $this->app; |
24 | 24 | |
25 | - $app->singleton('Services\ServiceCreator\ResponseCreator', function ($app) { |
|
25 | + $app->singleton('Services\ServiceCreator\ResponseCreator', function($app) { |
|
26 | 26 | return new services\serviceCreator\JsonResponseCreator(); |
27 | 27 | }); |
28 | 28 | } |