Code Duplication    Length = 11-12 lines in 2 locations

src/Http/Controllers/AkademikController.php 1 location

@@ 162-173 (lines=12) @@
159
     * @param  \App\Nilai  $nilai
160
     * @return \Illuminate\Http\Response
161
     */
162
    public function edit($id)
163
    {
164
        $akademik = $this->akademik->findOrFail($id);
165
166
        array_set($akademik->user, 'label', $akademik->user->name);
167
168
        $response['akademik'] = $akademik;
169
        $response['user'] = $akademik->user;
170
        $response['status'] = true;
171
172
        return response()->json($response);
173
    }
174
175
    /**
176
     * Update the specified resource in storage.

src/Http/Controllers/NilaiController.php 1 location

@@ 156-166 (lines=11) @@
153
     * @param  \Illuminate\Http\Request  $request
154
     * @return \Illuminate\Http\Response
155
     */
156
    public function show($id)
157
    {
158
        $nilai = $this->nilai->findOrFail($id);
159
160
        $response['user'] = $nilai->user;
161
        $response['nilai'] = $nilai;
162
        $response['siswa'] = $nilai->siswa;
163
        $response['status'] = true;
164
165
        return response()->json($response);
166
    }
167
168
    /**
169
     * Show the form for editing the specified resource.