Code Duplication    Length = 10-11 lines in 2 locations

src/Http/Controllers/StudiesController.php 2 locations

@@ 37-47 (lines=11) @@
34
     *
35
     * @return \Illuminate\Http\Response
36
     */
37
    public function index()
38
    {
39
        $this->repository->pushCriteria(app('Prettus\Repository\Criteria\RequestCriteria'));
40
        $studies = $this->repository->all();
41
        if (request()->wantsJson()) {
42
            return response()->json([
43
                'data' => $studies,
44
            ]);
45
        }
46
47
        return view('studies.index', compact('studies'));
48
    }
49
50
    /**
@@ 90-99 (lines=10) @@
87
     *
88
     * @return \Illuminate\Http\Response
89
     */
90
    public function show($id)
91
    {
92
        $study = $this->repository->find($id);
93
        if (request()->wantsJson()) {
94
            return response()->json([
95
                'data' => $study,
96
            ]);
97
        }
98
99
        return view('studies.show', compact('study'));
100
    }
101
102
    /**