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