Code Duplication    Length = 16-16 lines in 2 locations

src/Http/Controllers/MasterSktmController.php 1 location

@@ 292-307 (lines=16) @@
289
     * @param  \App\MasterSktm  $master-sktm
290
     * @return \Illuminate\Http\Response
291
     */
292
    public function destroy($id)
293
    {
294
        $master_sktm = $this->master_sktm->findOrFail($id);
295
296
        if ($master_sktm->delete()) {
297
            $response['message']    = 'Success';
298
            $response['success']    = true;
299
            $response['status']     = true;
300
        } else {
301
            $response['message']    = 'Failed';
302
            $response['success']    = false;
303
            $response['status']     = false;
304
        }
305
306
        return json_encode($response);
307
    }
308
}
309

src/Http/Controllers/SktmController.php 1 location

@@ 374-389 (lines=16) @@
371
     * @param  \App\Sktm  $nilai
372
     * @return \Illuminate\Http\Response
373
     */
374
    public function destroy($id)
375
    {
376
        $sktm = $this->sktm->findOrFail($id);
377
378
        if ($sktm->delete()) {
379
            $response['message']    = 'Success';
380
            $response['success']    = true;
381
            $response['status']     = true;
382
        } else {
383
            $response['message']    = 'Failed';
384
            $response['success']    = false;
385
            $response['status']     = false;
386
        }
387
388
        return json_encode($response);
389
    }
390
}
391