Code Duplication    Length = 12-12 lines in 3 locations

src/Http/Controllers/JenisPrestasiController.php 1 location

@@ 244-255 (lines=12) @@
241
     * @param  \App\Prestasi  $prestasi
242
     * @return \Illuminate\Http\Response
243
     */
244
    public function destroy($id)
245
    {
246
        $jenis_prestasi = $this->jenis_prestasi->findOrFail($id);
247
248
        if ($jenis_prestasi->delete()) {
249
            $response['status'] = true;
250
        } else {
251
            $response['status'] = false;
252
        }
253
254
        return json_encode($response);
255
    }
256
}
257

src/Http/Controllers/MasterPrestasiController.php 1 location

@@ 283-294 (lines=12) @@
280
     * @param  \App\Prestasi  $prestasi
281
     * @return \Illuminate\Http\Response
282
     */
283
    public function destroy($id)
284
    {
285
        $master_prestasi = $this->master_prestasi->findOrFail($id);
286
287
        if ($master_prestasi->delete()) {
288
            $response['status'] = true;
289
        } else {
290
            $response['status'] = false;
291
        }
292
        return json_encode($response);
293
    }
294
295
    public function juara(){
296
        return json_encode(array(
297
            array('id' => 1, 'label' => 'Juara 1'),

src/Http/Controllers/PrestasiController.php 1 location

@@ 353-364 (lines=12) @@
350
     * @param  \App\Prestasi  $prestasi
351
     * @return \Illuminate\Http\Response
352
     */
353
    public function destroy($id)
354
    {
355
        $prestasi = $this->prestasi->findOrFail($id);
356
357
        if ($prestasi->delete()) {
358
            $response['status'] = true;
359
        } else {
360
            $response['status'] = false;
361
        }
362
363
        return json_encode($response);
364
    }
365
366
    protected function checkRole($role = array())
367
    {