Code Duplication    Length = 11-11 lines in 7 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 2 locations

@@ 108-118 (lines=11) @@
105
     *
106
     * @return \Illuminate\Http\Response
107
     */
108
    public function get()
109
    {
110
        $admin_sekolahs = $this->admin_sekolah->with(['sekolah', 'user'])->get();
111
112
        $response['admin_sekolahs'] = $admin_sekolahs;
113
        $response['error']          = false;
114
        $response['message']        = 'Success';
115
        $response['status']         = true;
116
117
        return response()->json($response);
118
    }
119
120
    /**
121
     * Display a listing of the resource.
@@ 125-135 (lines=11) @@
122
     *
123
     * @return \Illuminate\Http\Response
124
     */
125
    public function getBySekolah($id)
126
    {
127
        $admin_sekolahs = $this->admin_sekolah->where('sekolah_id', '=', $id)->with(['sekolah', 'user'])->get();
128
129
        $response['admin_sekolahs'] = $admin_sekolahs;
130
        $response['message']        = 'Success';
131
        $response['error']          = false;
132
        $response['status']         = true;
133
134
        return response()->json($response);
135
    }
136
137
    /**
138
     * Show the form for creating a new resource.