Code Duplication    Length = 11-11 lines in 8 locations

src/Http/Controllers/ProdiSekolahController.php 2 locations

@@ 101-111 (lines=11) @@
98
     *
99
     * @return \Illuminate\Http\Response
100
     */
101
    public function getBySekolah($id)
102
    {
103
        $prodi_sekolahs = $this->prodi_sekolah->where('sekolah_id', '=', $id)->with(['sekolah', 'program_keahlian', 'user'])->get();
104
105
        $response['prodi_sekolahs'] = $prodi_sekolahs;
106
        $response['message']        = 'Success';
107
        $response['error']          = false;
108
        $response['status']         = true;
109
110
        return response()->json($response);
111
    }
112
113
    /**
114
     * Show the form for creating a new resource.
@@ 211-221 (lines=11) @@
208
     * @param  \App\ProdiSekolah  $prodi_sekolah
209
     * @return \Illuminate\Http\Response
210
     */
211
    public function show($id)
212
    {
213
        $prodi_sekolah = $this->prodi_sekolah->with(['sekolah', 'program_keahlian', 'user'])->findOrFail($id);
214
215
        $response['prodi_sekolah']  = $prodi_sekolah;
216
        $response['error']          = false;
217
        $response['message']        = 'Success';
218
        $response['status']         = true;
219
220
        return response()->json($response);
221
    }
222
223
    /**
224
     * Show the form for editing the specified resource.

src/Http/Controllers/JenisSekolahController.php 3 locations

@@ 76-86 (lines=11) @@
73
     *
74
     * @return \Illuminate\Http\Response
75
     */
76
    public function get()
77
    {
78
        $jenis_sekolahs = $this->jenis_sekolah->with('user')->get();
79
80
        $response['jenis_sekolahs'] = $jenis_sekolahs;
81
        $response['error']          = false;
82
        $response['message']        = 'Success';
83
        $response['status']         = true;
84
85
        return response()->json($response);
86
    }
87
88
    /**
89
     * Show the form for creating a new resource.
@@ 154-164 (lines=11) @@
151
     * @param  \App\JenisSekolah  $jenis_sekolah
152
     * @return \Illuminate\Http\Response
153
     */
154
    public function show($id)
155
    {
156
        $jenis_sekolah = $this->jenis_sekolah->with(['user'])->findOrFail($id);
157
158
        $response['jenis_sekolah']  = $jenis_sekolah;
159
        $response['error']          = false;
160
        $response['message']        = 'Success';
161
        $response['status']         = true;
162
163
        return response()->json($response);
164
    }
165
166
    /**
167
     * Show the form for editing the specified resource.
@@ 172-182 (lines=11) @@
169
     * @param  \App\JenisSekolah  $jenis_sekolah
170
     * @return \Illuminate\Http\Response
171
     */
172
    public function edit($id)
173
    {
174
        $jenis_sekolah = $this->jenis_sekolah->with(['user'])->findOrFail($id);
175
176
        $response['jenis_sekolah']  = $jenis_sekolah;
177
        $response['error']          = false;
178
        $response['message']        = 'Success';
179
        $response['status']         = true;
180
181
        return response()->json($response);
182
    }
183
184
    /**
185
     * Update the specified resource in storage.

src/Http/Controllers/AdminSekolahController.php 3 locations

@@ 81-91 (lines=11) @@
78
     *
79
     * @return \Illuminate\Http\Response
80
     */
81
    public function get()
82
    {
83
        $admin_sekolahs = $this->admin_sekolah->with(['sekolah', 'user'])->get();
84
85
        $response['admin_sekolahs'] = $admin_sekolahs;
86
        $response['error']          = false;
87
        $response['message']        = 'Success';
88
        $response['status']         = true;
89
90
        return response()->json($response);
91
    }
92
93
    /**
94
     * Display a listing of the resource.
@@ 98-108 (lines=11) @@
95
     *
96
     * @return \Illuminate\Http\Response
97
     */
98
    public function getBySekolah($id)
99
    {
100
        $admin_sekolahs = $this->admin_sekolah->where('sekolah_id', '=', $id)->with(['sekolah', 'user'])->get();
101
102
        $response['admin_sekolahs'] = $admin_sekolahs;
103
        $response['message']        = 'Success';
104
        $response['error']          = false;
105
        $response['status']         = true;
106
107
        return response()->json($response);
108
    }
109
110
    /**
111
     * Show the form for creating a new resource.
@@ 204-214 (lines=11) @@
201
     * @param  \App\ProdiSekolah  $prodi_sekolah
202
     * @return \Illuminate\Http\Response
203
     */
204
    public function show($id)
205
    {
206
        $admin_sekolah = $this->admin_sekolah->with(['sekolah', 'admin_sekolah', 'user'])->findOrFail($id);
207
208
        $response['admin_sekolah']  = $admin_sekolah;
209
        $response['error']          = false;
210
        $response['message']        = 'Success';
211
        $response['status']         = true;
212
213
        return response()->json($response);
214
    }
215
216
    /**
217
     * Show the form for editing the specified resource.