Code Duplication    Length = 13-14 lines in 2 locations

src/Http/Controllers/AttendancesController.php 2 locations

@@ 40-53 (lines=14) @@
37
     *
38
     * @return \Illuminate\Http\Response
39
     */
40
    public function index()
41
    {
42
        $this->repository->pushCriteria(app('Prettus\Repository\Criteria\RequestCriteria'));
43
        $attendances = $this->repository->all();
44
45
        if (request()->wantsJson()) {
46
47
            return response()->json([
48
                'data' => $attendances,
49
            ]);
50
        }
51
52
        return view('attendances.index', compact('attendances'));
53
    }
54
55
    //TODO : create
56
@@ 104-116 (lines=13) @@
101
     *
102
     * @return \Illuminate\Http\Response
103
     */
104
    public function show($id)
105
    {
106
        $attendance = $this->repository->find($id);
107
108
        if (request()->wantsJson()) {
109
110
            return response()->json([
111
                'data' => $attendance,
112
            ]);
113
        }
114
115
        return view('attendances.show', compact('attendance'));
116
    }
117
118
119
    /**