Code Duplication    Length = 15-15 lines in 2 locations

src/Http/Controllers/JenisSekolahController.php 1 location

@@ 75-89 (lines=15) @@
72
     *
73
     * @return \Illuminate\Http\Response
74
     */
75
    public function get()
76
    {
77
        $jenis_sekolahs = $this->jenis_sekolah->with('user')->get();
78
79
        foreach($jenis_sekolahs as $jenis_sekolah){
80
            array_set($jenis_sekolah, 'label', $jenis_sekolah->jenis_sekolah);
81
        }
82
83
        $response['jenis_sekolahs']   = $jenis_sekolahs;
84
        $response['error']      = false;
85
        $response['message']    = 'Success';
86
        $response['status']     = true;
87
88
        return response()->json($response);
89
    }
90
91
    /**
92
     * Show the form for creating a new resource.

src/Http/Controllers/ProdiSekolahController.php 1 location

@@ 84-98 (lines=15) @@
81
     *
82
     * @return \Illuminate\Http\Response
83
     */
84
    public function get()
85
    {
86
        $prodi_sekolahs = $this->prodi_sekolah->with('sekolah', 'program_keahlian', 'user')->get();
87
88
        foreach($prodi_sekolahs as $prodi_sekolah){
89
            array_set($prodi_sekolah, 'label', $prodi_sekolah->nama);
90
        }
91
92
        $response['prodi_sekolahs']   = $prodi_sekolahs;
93
        $response['error']      = false;
94
        $response['message']    = 'Success';
95
        $response['status']     = true;
96
97
        return response()->json($response);
98
    }
99
100
    /**
101
     * Show the form for creating a new resource.