Code Duplication    Length = 10-10 lines in 2 locations

app/Http/Controllers/FileLinks/FileLinksController.php 1 location

@@ 31-40 (lines=10) @@
28
    private $user;
29
30
    //  Only authorized users have access
31
    public function __construct()
32
    {
33
        //  Verify the user is logged in and has permissions for this page
34
        $this->middleware('auth');
35
        $this->middleware(function($request, $next) {
36
            $this->user = auth()->user();
37
            $this->authorize('hasAccess', 'use_file_links');
38
            return $next($request);
39
        });
40
    }
41
42
    //  Landing page shows all links that the user owns
43
    public function index()

app/Http/Controllers/FileLinks/LinkFilesController.php 1 location

@@ 24-33 (lines=10) @@
21
{
22
    private $user;
23
24
    public function __construct()
25
    {
26
        //  Verify the user is logged in and has permissions for this page
27
        $this->middleware('auth');
28
        $this->middleware(function($request, $next) {
29
            $this->user = auth()->user();
30
            $this->authorize('hasAccess', 'use_file_links');
31
            return $next($request);
32
        });
33
    }
34
35
    //  Add a file to the file link
36
    public function store(Request $request)