Code Duplication    Length = 20-21 lines in 2 locations

app/Http/Controllers/Installer/SystemsController.php 2 locations

@@ 36-55 (lines=20) @@
33
    }
34
35
    //  Open the form to create a new system
36
    public function create()
37
    {
38
        $categories = SystemCategories::all();
39
        $dataTypes  = SystemCustDataTypes::orderBy('name', 'ASC')->get();
40
        
41
        $dropDown = [];
42
        foreach($dataTypes as $type)
43
        {
44
            $dropDown[] = [
45
                'value' => $type->data_type_id,
46
                'label' => $type->name
47
            ];
48
        }
49
        
50
        Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id);
51
        return view('installer.newSystem', [
52
            'categories' => $categories,
53
            'dropDown'   => $dropDown
54
        ]);
55
    }
56
57
    //  Store the new system type
58
    public function store(Request $request)
@@ 134-154 (lines=21) @@
131
    }
132
133
    //  Edit an existing system
134
    public function edit($id)
135
    {
136
        $system = SystemTypes::find($id);
137
        $dataTypes = SystemCustDataTypes::orderBy('name', 'ASC')->get();
138
        
139
        $dropDown = [];
140
        foreach($dataTypes as $type)
141
        {
142
            $dropDown[] = [
143
                'value' => $type->data_type_id,
144
                'label' => $type->name
145
            ];
146
        }
147
        
148
        Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id);
149
        return view('installer.editSystem', [
150
            'sys_id'   => $id,
151
            'name'     => $system->name,
152
            'dropDown' => $dropDown
153
        ]);
154
    }
155
156
    //  Update the system data
157
    public function update(Request $request, $id)