Code Duplication    Length = 4-4 lines in 2 locations

src/Http/Controllers/ThreadsController.php 2 locations

@@ 101-104 (lines=4) @@
98
99
        $thread->attachSubscriber($user);
100
101
        if ($request->ajax())
102
            return $request->json([$thread], 200);
103
        else
104
            return redirect()->route('discuss.index')->with('success','Successfully created');
105
    }
106
107
    /**
@@ 169-172 (lines=4) @@
166
    {
167
        $thread->delete();
168
169
        if ($request->ajax())
170
            return $request->json([], 200);
171
        else
172
            return redirect()->route('discuss.index')->with('success','Successfully deleted');
173
    }
174
175
    private function slugify($string){