Code Duplication    Length = 25-25 lines in 2 locations

src/Http/Controllers/SekolahController.php 2 locations

@@ 187-211 (lines=25) @@
184
            'user_id'           => "required|exists:{$this->user->getTable()},id",
185
        ]);
186
187
        if ($validator->fails()) {
188
            $error      = true;
189
            $message    = $validator->errors()->first();
190
        } else {
191
            $sekolah->id                = $request->input('npsn');
192
            $sekolah->nama              = $request->input('nama');
193
            $sekolah->npsn              = $request->input('npsn');
194
            $sekolah->jenis_sekolah_id  = $request->input('jenis_sekolah_id');
195
            $sekolah->alamat            = $request->input('alamat');
196
            $sekolah->logo              = $request->input('logo');
197
            $sekolah->foto_gedung       = $request->input('foto_gedung');
198
            $sekolah->province_id       = $request->input('province_id');
199
            $sekolah->city_id           = $request->input('city_id');
200
            $sekolah->district_id       = $request->input('district_id');
201
            $sekolah->village_id        = $request->input('village_id');
202
            $sekolah->no_telp           = $request->input('no_telp');
203
            $sekolah->email             = $request->input('email');
204
            $sekolah->uuid              = $request->input('uuid');
205
            $sekolah->kode_zona         = $request->input('kode_zona');
206
            $sekolah->user_id           = $request->input('user_id');
207
            $sekolah->save();
208
209
            $error      = false;
210
            $message    = 'Success';
211
        }
212
213
        $response['error']      = $error;
214
        $response['message']    = $message;
@@ 341-365 (lines=25) @@
338
            'user_id'           => "required|exists:{$this->user->getTable()},id",
339
        ]);
340
341
        if ($validator->fails()) {
342
            $error      = true;
343
            $message    = $validator->errors()->first();
344
        } else {
345
            $sekolah->id                = $request->input('npsn');
346
            $sekolah->nama              = $request->input('nama');
347
            $sekolah->npsn              = $request->input('npsn');
348
            $sekolah->jenis_sekolah_id  = $request->input('jenis_sekolah_id');
349
            $sekolah->alamat            = $request->input('alamat');
350
            $sekolah->logo              = $request->input('logo');
351
            $sekolah->foto_gedung       = $request->input('foto_gedung');
352
            $sekolah->province_id       = $request->input('province_id');
353
            $sekolah->city_id           = $request->input('city_id');
354
            $sekolah->district_id       = $request->input('district_id');
355
            $sekolah->village_id        = $request->input('village_id');
356
            $sekolah->no_telp           = $request->input('no_telp');
357
            $sekolah->email             = $request->input('email');
358
            $sekolah->uuid              = $request->input('uuid');
359
            $sekolah->kode_zona         = $request->input('kode_zona');
360
            $sekolah->user_id           = $request->input('user_id');
361
            $sekolah->save();
362
363
            $error      = false;
364
            $message    = 'Success';
365
        }
366
367
        $response['error']      = $error;
368
        $response['message']    = $message;