Code Duplication    Length = 232-232 lines in 3 locations

app/Api/Controllers/Profile/DependentsController.php 1 location

@@ 30-261 (lines=232) @@
27
use Irradiate\Eloquent\Employee;
28
use Swagger\Annotations as SWG;
29
30
class DependentsController extends BaseController
31
{
32
    /**
33
     * @var Employee
34
     */
35
    protected $employee;
36
37
    /**
38
     * @var Dependent
39
     */
40
    protected $dependent;
41
42
    /**
43
     * @param Employee  $employee
44
     * @param Dependent $dependent
45
     *
46
     * @author Bertrand Kintanar <[email protected]>
47
     */
48
    public function __construct(Employee $employee, Dependent $dependent)
49
    {
50
        $this->employee = $employee;
51
        $this->dependent = $dependent;
52
    }
53
54
    /**
55
     * Stores a single instance of Dependent.
56
     *
57
     * @SWG\Post(
58
     *     path="/profile/dependents",
59
     *     description="This route provides the ability to store a single instance of Dependent.",
60
     *     tags={"Employee Profiles"},
61
     *     consumes={"application/json"},
62
     *     summary="Stores a single instance of Dependent.",
63
     *     @SWG\Response(response="201", description="Success",
64
     *         @SWG\Schema(
65
     *             title="data",
66
     *             type="object",
67
     *             required={"dependent", "message", "status_code"},
68
     *             @SWG\Property(property="dependent", ref="#/definitions/Dependent"),
69
     *             @SWG\Property(property="message", type="string", default="Record successfully added.", description="Status message from server"),
70
     *             @SWG\Property(property="status_code", type="integer", default=201, description="Status code from server"),
71
     *         )
72
     *     ),
73
     *     @SWG\Response(response="400", description="Token not provided",
74
     *         @SWG\Schema(
75
     *             title="data",
76
     *             type="object",
77
     *             required={"message", "status_code", "debug"},
78
     *             @SWG\Property(property="message", type="string", default="Token not provided", description="Error message from server"),
79
     *             @SWG\Property(property="status_code", type="integer", default=400, description="Status code from server"),
80
     *             @SWG\Property(property="debug", type="object", description="Debug back trace"),
81
     *         )
82
     *     ),
83
     *     @SWG\Response(response="422", description="Unable to add record to the database.",
84
     *         @SWG\Schema(
85
     *             title="data",
86
     *             type="object",
87
     *             required={"message", "status_code"},
88
     *             @SWG\Property(property="message", type="string", default="Unable to add record to the database.", description="Status message from server"),
89
     *             @SWG\Property(property="status_code", type="integer", default=422, description="Status code from server"),
90
     *         )
91
     *     ),
92
     *     @SWG\Parameter(
93
     *         name="dependent",
94
     *         in="body",
95
     *         required=true,
96
     *         @SWG\Property(ref="#/definitions/Dependent")
97
     *     ),
98
     *     @SWG\Parameter(
99
     *         name="Authorization",
100
     *         in="header",
101
     *         description="JWT Token",
102
     *         required=true,
103
     *         type="string",
104
     *         default="Bearer "
105
     *     ),
106
     * )
107
     *
108
     * @param DependentsRequest $request
109
     *
110
     * @return \Dingo\Api\Http\Response
111
     *
112
     * @author Bertrand Kintanar <[email protected]>
113
     */
114
    public function store(DependentsRequest $request)
115
    {
116
        return $this->storeModel($request, $this->dependent, 'dependent');
117
    }
118
119
    /**
120
     * Updates a single instance of Dependent.
121
     *
122
     * @SWG\Patch(
123
     *     path="/profile/dependents",
124
     *     description="This route provides the ability to update a single instance of Dependent.",
125
     *     tags={"Employee Profiles"},
126
     *     consumes={"application/json"},
127
     *     summary="Updates a single instance of Dependent.",
128
     *     @SWG\Response(response="200", description="Success",
129
     *         @SWG\Schema(
130
     *             title="data",
131
     *             type="object",
132
     *             required={"message", "status_code"},
133
     *             @SWG\Property(property="message", type="string", default="Record successfully updated.", description="Status message from server"),
134
     *             @SWG\Property(property="status_code", type="integer", default=200, description="Status code from server"),
135
     *         )
136
     *     ),
137
     *     @SWG\Response(response="400", description="Token not provided",
138
     *         @SWG\Schema(
139
     *             title="data",
140
     *             type="object",
141
     *             required={"message", "status_code", "debug"},
142
     *             @SWG\Property(property="message", type="string", default="Token not provided", description="Error message from server"),
143
     *             @SWG\Property(property="status_code", type="integer", default=400, description="Status code from server"),
144
     *             @SWG\Property(property="debug", type="object", description="Debug back trace"),
145
     *         )
146
     *     ),
147
     *     @SWG\Response(response="404", description="Unable to retrieve record from database.",
148
     *         @SWG\Schema(
149
     *             title="data",
150
     *             type="object",
151
     *             required={"message", "status_code", "debug"},
152
     *             @SWG\Property(property="message", type="string", default="Unable to retrieve record from database.", description="Error message from server"),
153
     *             @SWG\Property(property="status_code", type="integer", default=400, description="Status code from server"),
154
     *             @SWG\Property(property="debug", type="object", description="Debug back trace"),
155
     *         )
156
     *     ),
157
     *     @SWG\Response(response="422", description="Unable to update record.",
158
     *         @SWG\Schema(
159
     *             title="data",
160
     *             type="object",
161
     *             required={"message", "status_code"},
162
     *             @SWG\Property(property="message", type="string", default="Unable to update record.", description="Status message from server"),
163
     *             @SWG\Property(property="status_code", type="integer", default=422, description="Status code from server"),
164
     *         )
165
     *     ),
166
     *     @SWG\Parameter(
167
     *         name="dependent",
168
     *         in="body",
169
     *         required=true,
170
     *         description="employee's dependent object that needs to be updated",
171
     *         @SWG\Property(ref="#/definitions/Dependent")
172
     *     ),
173
     *     @SWG\Parameter(
174
     *         name="Authorization",
175
     *         in="header",
176
     *         description="JWT Token",
177
     *         required=true,
178
     *         type="string",
179
     *         default="Bearer "
180
     *     ),
181
     * )
182
     *
183
     * @param DependentsRequest $request
184
     *
185
     * @return \Dingo\Api\Http\Response
186
     *
187
     * @author Bertrand Kintanar <[email protected]>
188
     */
189
    public function update(DependentsRequest $request)
190
    {
191
        return $this->updateModel($request, $this->dependent);
192
    }
193
194
    /**
195
     * Deletes a single instance of Dependent.
196
     *
197
     * @SWG\Delete(
198
     *     path="/profile/dependents/{dependent}",
199
     *     description="This route provides the ability to delete a Dependent.",
200
     *     tags={"Employee Profiles"},
201
     *     consumes={"application/json"},
202
     *     summary="Deletes a single instance of Dependent.",
203
     *     @SWG\Response(response="200", description="Success",
204
     *         @SWG\Schema(
205
     *             title="data",
206
     *             type="object",
207
     *             required={"message", "status_code"},
208
     *             @SWG\Property(property="message", type="string", default="Record successfully deleted.", description="Status message from server"),
209
     *             @SWG\Property(property="status_code", type="integer", default=200, description="Status code from server"),
210
     *         )
211
     *     ),
212
     *     @SWG\Response(response="400", description="Token not provided",
213
     *         @SWG\Schema(
214
     *             title="data",
215
     *             type="object",
216
     *             required={"message", "status_code", "debug"},
217
     *             @SWG\Property(property="message", type="string", default="Token not provided", description="Error message from server"),
218
     *             @SWG\Property(property="status_code", type="integer", default=400, description="Status code from server"),
219
     *             @SWG\Property(property="debug", type="object", description="Debug back trace"),
220
     *         )
221
     *     ),
222
     *     @SWG\Response(response="422", description="422 Unprocessable Entity",
223
     *         @SWG\Schema(
224
     *             title="data",
225
     *             type="object",
226
     *             required={"message", "status_code"},
227
     *             @SWG\Property(property="message", type="string", default="422 Unprocessable Entity", description="Status message from server"),
228
     *             @SWG\Property(property="status_code", type="integer", default=422, description="Status code from server"),
229
     *         )
230
     *     ),
231
     *     @SWG\Parameter(
232
     *         name="dependent",
233
     *         in="path",
234
     *         description="Dependent id to be deleted",
235
     *         required=true,
236
     *         type="integer",
237
     *         format="int64",
238
     *         default=1,
239
     *     ),
240
     *     @SWG\Parameter(
241
     *         name="Authorization",
242
     *         in="header",
243
     *         description="JWT Token",
244
     *         required=true,
245
     *         type="string",
246
     *         default="Bearer "
247
     *     ),
248
     * )
249
     *
250
     * @param Dependent         $dependent
251
     * @param DependentsRequest $request
252
     *
253
     * @return \Dingo\Api\Http\Response
254
     *
255
     * @author Bertrand Kintanar <[email protected]>
256
     */
257
    public function destroy(Dependent $dependent, DependentsRequest $request)
258
    {
259
        return $this->destroyModel($dependent, $this->dependent);
260
    }
261
}
262

app/Api/Controllers/Profile/EmergencyContactsController.php 1 location

@@ 30-261 (lines=232) @@
27
use Irradiate\Eloquent\Employee;
28
use Swagger\Annotations as SWG;
29
30
class EmergencyContactsController extends BaseController
31
{
32
    /**
33
     * @var Employee
34
     */
35
    protected $employee;
36
37
    /**
38
     * @var EmergencyContact
39
     */
40
    protected $emergency_contact;
41
42
    /**
43
     * @param Employee         $employee
44
     * @param EmergencyContact $emergency_contact
45
     *
46
     * @author Bertrand Kintanar <[email protected]>
47
     */
48
    public function __construct(Employee $employee, EmergencyContact $emergency_contact)
49
    {
50
        $this->employee = $employee;
51
        $this->emergency_contact = $emergency_contact;
52
    }
53
54
    /**
55
     * Stores a single instance of Emergency Contact.
56
     *
57
     * @SWG\Post(
58
     *     path="/profile/emergency-contacts",
59
     *     description="This route provides the ability to store a single instance of Emergency Contact.",
60
     *     tags={"Employee Profiles"},
61
     *     consumes={"application/json"},
62
     *     summary="Stores a single instance of Emergency Contact.",
63
     *     @SWG\Response(response="201", description="Success",
64
     *         @SWG\Schema(
65
     *             title="data",
66
     *             type="object",
67
     *             required={"emergency_contact", "message", "status_code"},
68
     *             @SWG\Property(property="emergency_contact", ref="#/definitions/EmergencyContact"),
69
     *             @SWG\Property(property="message", type="string", default="Record successfully added.", description="Status message from server"),
70
     *             @SWG\Property(property="status_code", type="integer", default=201, description="Status code from server"),
71
     *         )
72
     *     ),
73
     *     @SWG\Response(response="400", description="Token not provided",
74
     *         @SWG\Schema(
75
     *             title="data",
76
     *             type="object",
77
     *             required={"message", "status_code", "debug"},
78
     *             @SWG\Property(property="message", type="string", default="Token not provided", description="Error message from server"),
79
     *             @SWG\Property(property="status_code", type="integer", default=400, description="Status code from server"),
80
     *             @SWG\Property(property="debug", type="object", description="Debug back trace"),
81
     *         )
82
     *     ),
83
     *     @SWG\Response(response="422", description="Unable to add record to the database.",
84
     *         @SWG\Schema(
85
     *             title="data",
86
     *             type="object",
87
     *             required={"message", "status_code"},
88
     *             @SWG\Property(property="message", type="string", default="Unable to add record to the database.", description="Status message from server"),
89
     *             @SWG\Property(property="status_code", type="integer", default=422, description="Status code from server"),
90
     *         )
91
     *     ),
92
     *     @SWG\Parameter(
93
     *         name="emergency_contact",
94
     *         in="body",
95
     *         required=true,
96
     *         @SWG\Property(ref="#/definitions/EmergencyContact")
97
     *     ),
98
     *     @SWG\Parameter(
99
     *         name="Authorization",
100
     *         in="header",
101
     *         description="JWT Token",
102
     *         required=true,
103
     *         type="string",
104
     *         default="Bearer "
105
     *     ),
106
     * )
107
     *
108
     * @param EmergencyContactsRequest $request
109
     *
110
     * @return \Dingo\Api\Http\Response
111
     *
112
     * @author Bertrand Kintanar <[email protected]>
113
     */
114
    public function store(EmergencyContactsRequest $request)
115
    {
116
        return $this->storeModel($request, $this->emergency_contact, 'emergency_contact');
117
    }
118
119
    /**
120
     * Updates a single instance of Emergency Contact.
121
     *
122
     * @SWG\Patch(
123
     *     path="/profile/emergency-contacts",
124
     *     description="This route provides the ability to update a single instance of Emergency Contact.",
125
     *     tags={"Employee Profiles"},
126
     *     consumes={"application/json"},
127
     *     summary="Updates a single instance of Emergency Contact.",
128
     *     @SWG\Response(response="200", description="Success",
129
     *         @SWG\Schema(
130
     *             title="data",
131
     *             type="object",
132
     *             required={"message", "status_code"},
133
     *             @SWG\Property(property="message", type="string", default="Record successfully updated.", description="Status message from server"),
134
     *             @SWG\Property(property="status_code", type="integer", default=200, description="Status code from server"),
135
     *         )
136
     *     ),
137
     *     @SWG\Response(response="400", description="Token not provided",
138
     *         @SWG\Schema(
139
     *             title="data",
140
     *             type="object",
141
     *             required={"message", "status_code", "debug"},
142
     *             @SWG\Property(property="message", type="string", default="Token not provided", description="Error message from server"),
143
     *             @SWG\Property(property="status_code", type="integer", default=400, description="Status code from server"),
144
     *             @SWG\Property(property="debug", type="object", description="Debug back trace"),
145
     *         )
146
     *     ),
147
     *     @SWG\Response(response="404", description="Unable to retrieve record from database.",
148
     *         @SWG\Schema(
149
     *             title="data",
150
     *             type="object",
151
     *             required={"message", "status_code", "debug"},
152
     *             @SWG\Property(property="message", type="string", default="Unable to retrieve record from database.", description="Error message from server"),
153
     *             @SWG\Property(property="status_code", type="integer", default=400, description="Status code from server"),
154
     *             @SWG\Property(property="debug", type="object", description="Debug back trace"),
155
     *         )
156
     *     ),
157
     *     @SWG\Response(response="422", description="Unable to update record.",
158
     *         @SWG\Schema(
159
     *             title="data",
160
     *             type="object",
161
     *             required={"message", "status_code"},
162
     *             @SWG\Property(property="message", type="string", default="Unable to update record.", description="Status message from server"),
163
     *             @SWG\Property(property="status_code", type="integer", default=422, description="Status code from server"),
164
     *         )
165
     *     ),
166
     *     @SWG\Parameter(
167
     *         name="emergency_contact",
168
     *         in="body",
169
     *         required=true,
170
     *         description="Emergency contact object that needs to be updated",
171
     *         @SWG\Property(ref="#/definitions/EmergencyContact")
172
     *     ),
173
     *     @SWG\Parameter(
174
     *         name="Authorization",
175
     *         in="header",
176
     *         description="JWT Token",
177
     *         required=true,
178
     *         type="string",
179
     *         default="Bearer "
180
     *     ),
181
     * )
182
     *
183
     * @param EmergencyContactsRequest $request
184
     *
185
     * @return \Dingo\Api\Http\Response
186
     *
187
     * @author Bertrand Kintanar <[email protected]>
188
     */
189
    public function update(EmergencyContactsRequest $request)
190
    {
191
        return $this->updateModel($request, $this->emergency_contact);
192
    }
193
194
    /**
195
     * Deletes a single instance of Emergency Contact.
196
     *
197
     * @SWG\Delete(
198
     *     path="/profile/emergency-contacts/{emergency_contact}",
199
     *     description="This route provides the ability to delete a Emergency Contact.",
200
     *     tags={"Employee Profiles"},
201
     *     consumes={"application/json"},
202
     *     summary="Deletes a single instance of Emergency Contact.",
203
     *     @SWG\Response(response="200", description="Success",
204
     *         @SWG\Schema(
205
     *             title="data",
206
     *             type="object",
207
     *             required={"message", "status_code"},
208
     *             @SWG\Property(property="message", type="string", default="Record successfully deleted.", description="Status message from server"),
209
     *             @SWG\Property(property="status_code", type="integer", default=200, description="Status code from server"),
210
     *         )
211
     *     ),
212
     *     @SWG\Response(response="400", description="Token not provided",
213
     *         @SWG\Schema(
214
     *             title="data",
215
     *             type="object",
216
     *             required={"message", "status_code", "debug"},
217
     *             @SWG\Property(property="message", type="string", default="Token not provided", description="Error message from server"),
218
     *             @SWG\Property(property="status_code", type="integer", default=400, description="Status code from server"),
219
     *             @SWG\Property(property="debug", type="object", description="Debug back trace"),
220
     *         )
221
     *     ),
222
     *     @SWG\Response(response="422", description="422 Unprocessable Entity",
223
     *         @SWG\Schema(
224
     *             title="data",
225
     *             type="object",
226
     *             required={"message", "status_code"},
227
     *             @SWG\Property(property="message", type="string", default="422 Unprocessable Entity", description="Status message from server"),
228
     *             @SWG\Property(property="status_code", type="integer", default=422, description="Status code from server"),
229
     *         )
230
     *     ),
231
     *     @SWG\Parameter(
232
     *         name="emergency_contact",
233
     *         in="path",
234
     *         description="Emergency contact id to be deleted",
235
     *         required=true,
236
     *         type="integer",
237
     *         format="int64",
238
     *         default=1,
239
     *     ),
240
     *     @SWG\Parameter(
241
     *         name="Authorization",
242
     *         in="header",
243
     *         description="JWT Token",
244
     *         required=true,
245
     *         type="string",
246
     *         default="Bearer "
247
     *     ),
248
     * )
249
     *
250
     * @param EmergencyContact         $emergency_contact
251
     * @param EmergencyContactsRequest $request
252
     *
253
     * @return \Dingo\Api\Http\Response
254
     *
255
     * @author Bertrand Kintanar <[email protected]>
256
     */
257
    public function destroy(EmergencyContact $emergency_contact, EmergencyContactsRequest $request)
258
    {
259
        return $this->destroyModel($emergency_contact, $this->emergency_contact);
260
    }
261
}
262

app/Api/Controllers/Profile/ReportsToController.php 1 location

@@ 30-261 (lines=232) @@
27
use Irradiate\Eloquent\EmployeeSupervisor;
28
use Swagger\Annotations as SWG;
29
30
class ReportsToController extends BaseController
31
{
32
    /**
33
     * @var Employee
34
     */
35
    protected $employee;
36
37
    /**
38
     * @var EmployeeSupervisor
39
     */
40
    protected $employee_supervisor;
41
42
    /**
43
     * @param Employee           $employee
44
     * @param EmployeeSupervisor $employee_supervisor
45
     *
46
     * @author Bertrand Kintanar <[email protected]>
47
     */
48
    public function __construct(Employee $employee, EmployeeSupervisor $employee_supervisor)
49
    {
50
        $this->employee = $employee;
51
        $this->employee_supervisor = $employee_supervisor;
52
    }
53
54
    /**
55
     * Stores a single instance of Employee Supervisor.
56
     *
57
     * @SWG\Post(
58
     *     path="/profile/reports-to",
59
     *     description="This route provides the ability to store a single instance of Employee Supervisor.",
60
     *     tags={"Employee Profiles"},
61
     *     consumes={"application/json"},
62
     *     summary="Stores a single instance of Employee Supervisor.",
63
     *     @SWG\Response(response="201", description="Success",
64
     *         @SWG\Schema(
65
     *             title="data",
66
     *             type="object",
67
     *             required={"supervisor", "message", "status_code"},
68
     *             @SWG\Property(property="supervisor", ref="#/definitions/Employee"),
69
     *             @SWG\Property(property="message", type="string", default="Record successfully added.", description="Status message from server"),
70
     *             @SWG\Property(property="status_code", type="integer", default=201, description="Status code from server"),
71
     *         )
72
     *     ),
73
     *     @SWG\Response(response="400", description="Token not provided",
74
     *         @SWG\Schema(
75
     *             title="data",
76
     *             type="object",
77
     *             required={"message", "status_code", "debug"},
78
     *             @SWG\Property(property="message", type="string", default="Token not provided", description="Error message from server"),
79
     *             @SWG\Property(property="status_code", type="integer", default=400, description="Status code from server"),
80
     *             @SWG\Property(property="debug", type="object", description="Debug back trace"),
81
     *         )
82
     *     ),
83
     *     @SWG\Response(response="422", description="Unable to add record to the database.",
84
     *         @SWG\Schema(
85
     *             title="data",
86
     *             type="object",
87
     *             required={"message", "status_code"},
88
     *             @SWG\Property(property="message", type="string", default="Unable to add record to the database.", description="Status message from server"),
89
     *             @SWG\Property(property="status_code", type="integer", default=422, description="Status code from server"),
90
     *         )
91
     *     ),
92
     *     @SWG\Parameter(
93
     *         name="supervisor",
94
     *         in="body",
95
     *         required=true,
96
     *         @SWG\Property(ref="#/definitions/Employee")
97
     *     ),
98
     *     @SWG\Parameter(
99
     *         name="Authorization",
100
     *         in="header",
101
     *         description="JWT Token",
102
     *         required=true,
103
     *         type="string",
104
     *         default="Bearer "
105
     *     ),
106
     * )
107
     *
108
     * @param ReportsToRequest $request
109
     *
110
     * @return \Dingo\Api\Http\Response
111
     *
112
     * @author Bertrand Kintanar <[email protected]>
113
     */
114
    public function store(ReportsToRequest $request)
115
    {
116
        return $this->storeModel($request, $this->employee_supervisor, 'supervisor');
117
    }
118
119
    /**
120
     * Updates a single instance of Employee Supervisor.
121
     *
122
     * @SWG\Patch(
123
     *     path="/profile/reports-to",
124
     *     description="This route provides the ability to update a single instance of Employee Supervisor.",
125
     *     tags={"Employee Profiles"},
126
     *     consumes={"application/json"},
127
     *     summary="Updates a single instance of Employee Supervisor.",
128
     *     @SWG\Response(response="200", description="Success",
129
     *         @SWG\Schema(
130
     *             title="data",
131
     *             type="object",
132
     *             required={"message", "status_code"},
133
     *             @SWG\Property(property="message", type="string", default="Record successfully updated.", description="Status message from server"),
134
     *             @SWG\Property(property="status_code", type="integer", default=200, description="Status code from server"),
135
     *         )
136
     *     ),
137
     *     @SWG\Response(response="400", description="Token not provided",
138
     *         @SWG\Schema(
139
     *             title="data",
140
     *             type="object",
141
     *             required={"message", "status_code", "debug"},
142
     *             @SWG\Property(property="message", type="string", default="Token not provided", description="Error message from server"),
143
     *             @SWG\Property(property="status_code", type="integer", default=400, description="Status code from server"),
144
     *             @SWG\Property(property="debug", type="object", description="Debug back trace"),
145
     *         )
146
     *     ),
147
     *     @SWG\Response(response="404", description="Unable to retrieve record from database.",
148
     *         @SWG\Schema(
149
     *             title="data",
150
     *             type="object",
151
     *             required={"message", "status_code", "debug"},
152
     *             @SWG\Property(property="message", type="string", default="Unable to retrieve record from database.", description="Error message from server"),
153
     *             @SWG\Property(property="status_code", type="integer", default=400, description="Status code from server"),
154
     *             @SWG\Property(property="debug", type="object", description="Debug back trace"),
155
     *         )
156
     *     ),
157
     *     @SWG\Response(response="422", description="Unable to update record.",
158
     *         @SWG\Schema(
159
     *             title="data",
160
     *             type="object",
161
     *             required={"message", "status_code"},
162
     *             @SWG\Property(property="message", type="string", default="Unable to update record.", description="Status message from server"),
163
     *             @SWG\Property(property="status_code", type="integer", default=422, description="Status code from server"),
164
     *         )
165
     *     ),
166
     *     @SWG\Parameter(
167
     *         name="supervisor",
168
     *         in="body",
169
     *         required=true,
170
     *         description="employee's supervisor object that needs to be updated",
171
     *         @SWG\Property(ref="#/definitions/Employee")
172
     *     ),
173
     *     @SWG\Parameter(
174
     *         name="Authorization",
175
     *         in="header",
176
     *         description="JWT Token",
177
     *         required=true,
178
     *         type="string",
179
     *         default="Bearer "
180
     *     ),
181
     * )
182
     *
183
     * @param ReportsToRequest $request
184
     *
185
     * @return \Dingo\Api\Http\Response
186
     *
187
     * @author Bertrand Kintanar <[email protected]>
188
     */
189
    public function update(ReportsToRequest $request)
190
    {
191
        return $this->updateModel($request, $this->employee_supervisor);
192
    }
193
194
    /**
195
     * Deletes a single instance of EmployeeSupervisor.
196
     *
197
     * @SWG\Delete(
198
     *     path="/profile/reports-to/{employee_supervisor}",
199
     *     description="This route provides the ability to delete a EmployeeSupervisor.",
200
     *     tags={"Employee Profiles"},
201
     *     consumes={"application/json"},
202
     *     summary="Deletes a single instance of EmployeeSupervisor.",
203
     *     @SWG\Response(response="200", description="Success",
204
     *         @SWG\Schema(
205
     *             title="data",
206
     *             type="object",
207
     *             required={"message", "status_code"},
208
     *             @SWG\Property(property="message", type="string", default="Record successfully deleted.", description="Status message from server"),
209
     *             @SWG\Property(property="status_code", type="integer", default=200, description="Status code from server"),
210
     *         )
211
     *     ),
212
     *     @SWG\Response(response="400", description="Token not provided",
213
     *         @SWG\Schema(
214
     *             title="data",
215
     *             type="object",
216
     *             required={"message", "status_code", "debug"},
217
     *             @SWG\Property(property="message", type="string", default="Token not provided", description="Error message from server"),
218
     *             @SWG\Property(property="status_code", type="integer", default=400, description="Status code from server"),
219
     *             @SWG\Property(property="debug", type="object", description="Debug back trace"),
220
     *         )
221
     *     ),
222
     *     @SWG\Response(response="422", description="422 Unprocessable Entity",
223
     *         @SWG\Schema(
224
     *             title="data",
225
     *             type="object",
226
     *             required={"message", "status_code"},
227
     *             @SWG\Property(property="message", type="string", default="422 Unprocessable Entity", description="Status message from server"),
228
     *             @SWG\Property(property="status_code", type="integer", default=422, description="Status code from server"),
229
     *         )
230
     *     ),
231
     *     @SWG\Parameter(
232
     *         name="employee_supervisor",
233
     *         in="path",
234
     *         description="Employee supervisor id to be deleted",
235
     *         required=true,
236
     *         type="integer",
237
     *         format="int64",
238
     *         default=1,
239
     *     ),
240
     *     @SWG\Parameter(
241
     *         name="Authorization",
242
     *         in="header",
243
     *         description="JWT Token",
244
     *         required=true,
245
     *         type="string",
246
     *         default="Bearer "
247
     *     ),
248
     * )
249
     *
250
     * @param EmployeeSupervisor $employee_supervisor
251
     * @param ReportsToRequest   $request
252
     *
253
     * @return \Dingo\Api\Http\Response
254
     *
255
     * @author Bertrand Kintanar <[email protected]>
256
     */
257
    public function destroy(EmployeeSupervisor $employee_supervisor, ReportsToRequest $request)
258
    {
259
        return $this->destroyModel($employee_supervisor, $this->employee_supervisor);
260
    }
261
}
262