Code Duplication    Length = 14-14 lines in 2 locations

app/Http/Controllers/BuildersController.php 1 location

@@ 195-208 (lines=14) @@
192
    /**
193
     * List account
194
     */
195
    public function listAccount()
196
    {
197
        $manager = new \MongoDB\Driver\Manager('mongodb://localhost:27017');
198
        $collection = new \MongoDB\Collection($manager, 'builders', 'account');
199
200
        $result = $collection->find()->toArray();
201
202
        $tab = [];
203
        foreach($result as $one){
204
            $tab[] = $one->bsonSerialize();
205
        }
206
207
        return response()->json($tab);
208
    }
209
210
211

app/Http/Controllers/AdController.php 1 location

@@ 81-94 (lines=14) @@
78
    /**
79
     * List ads
80
     */
81
    public function ads()
82
    {
83
        $manager = new \MongoDB\Driver\Manager('mongodb://localhost:27017');
84
        $collection = new \MongoDB\Collection($manager, 'builders', 'ads');
85
86
        $result = $collection->find()->toArray();
87
88
        $tab = [];
89
        foreach($result as $one){
90
            $tab[] = $one->bsonSerialize();
91
        }
92
93
        return response()->json($tab);
94
    }
95
96
97
}