1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace CodexShaper\DBM\Http\Controllers; |
4
|
|
|
|
5
|
|
|
use CodexShaper\DBM\Database\Schema\Table; |
6
|
|
|
use CodexShaper\DBM\Facades\Driver; |
7
|
|
|
use CodexShaper\DBM\Models\CollectionField; |
8
|
|
|
use CodexShaper\DBM\Models\DBM_Collection; |
9
|
|
|
use DBM; |
|
|
|
|
10
|
|
|
use Illuminate\Http\Request; |
11
|
|
|
use Illuminate\Support\Str; |
12
|
|
|
|
13
|
|
|
class DatabaseController extends Controller |
14
|
|
|
{ |
15
|
|
|
|
16
|
|
|
public function index() |
17
|
|
|
{ |
18
|
|
|
return view('dbm::app'); |
19
|
|
|
} |
20
|
|
|
|
21
|
|
|
public function all(Request $request) |
22
|
|
|
{ |
23
|
|
|
// return response()->json(['success' => false, 'data' => escapeshellarg($request->perPage)]); |
24
|
|
|
if ($request->ajax()) { |
25
|
|
|
|
26
|
|
|
if (($response = DBM::authorize('database.browse')) !== true) { |
27
|
|
|
return $response; |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
try |
31
|
|
|
{ |
32
|
|
|
$perPage = (int) $request->perPage; |
33
|
|
|
$query = $request->q; |
34
|
|
|
$tables = Table::paginate($perPage, null, [], $query); |
35
|
|
|
$userPermissions = DBM::userPermissions(); |
36
|
|
|
|
37
|
|
|
$newTables = []; |
38
|
|
|
|
39
|
|
|
foreach ($tables as $table) { |
40
|
|
|
|
41
|
|
|
$newTables[] = $table; |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
return response()->json([ |
45
|
|
|
'success' => true, |
46
|
|
|
'tables' => $newTables, |
47
|
|
|
'pagination' => $tables, |
48
|
|
|
'userPermissions' => $userPermissions, |
49
|
|
|
]); |
50
|
|
|
|
51
|
|
|
} catch (\Exception $e) { |
52
|
|
|
return response()->json([ |
53
|
|
|
'success' => false, |
54
|
|
|
'errors' => [$e->getMessage()], |
55
|
|
|
], 400); |
56
|
|
|
} |
57
|
|
|
} |
58
|
|
|
return response()->json(['success' => false]); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
public function getTable(Request $request) |
62
|
|
|
{ |
63
|
|
|
if ($request->ajax()) { |
64
|
|
|
|
65
|
|
|
if (($response = DBM::authorize('database.update')) !== true) { |
66
|
|
|
return $response; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
$userPermissions = DBM::userPermissions(); |
70
|
|
|
$table = Table::getTable($request->name); |
71
|
|
|
$object = DBM::Object()->where('name', $request->name)->first(); |
72
|
|
|
$isCrudExists = false; |
73
|
|
|
$columns = $table['columns']; |
74
|
|
|
$newColumns = []; |
75
|
|
|
|
76
|
|
|
if ($object) { |
77
|
|
|
$fields = $object->fields()->orderBy('order', 'ASC')->get(); |
78
|
|
|
if (count($fields) > 0) { |
79
|
|
|
foreach ($fields as $field) { |
80
|
|
|
foreach ($columns as $key => $column) { |
81
|
|
|
if ($field->name == $column->name) { |
82
|
|
|
// $column->id = $field->id; |
83
|
|
|
$column->order = $field->order; |
84
|
|
|
$newColumns[] = $column; |
85
|
|
|
unset($columns[$key]); |
86
|
|
|
$columns = array_values($columns); |
87
|
|
|
} |
88
|
|
|
} |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
$table['columns'] = $newColumns; |
92
|
|
|
// $columns = $newColumns; |
93
|
|
|
$isCrudExists = true; |
94
|
|
|
} |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
return response()->json([ |
98
|
|
|
'success' => true, |
99
|
|
|
'table' => $table, |
100
|
|
|
'isCrudExists' => $isCrudExists, |
101
|
|
|
'userPermissions' => $userPermissions, |
102
|
|
|
'templates' => DBM::templates(), |
103
|
|
|
]); |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
return response()->json(['success' => false]); |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
public function getTableColumns(Request $request) |
110
|
|
|
{ |
111
|
|
|
if ($request->ajax()) { |
112
|
|
|
|
113
|
|
|
if (($response = DBM::authorize('crud.update')) !== true) { |
114
|
|
|
return $response; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
$table = Table::getTable($request->table); |
118
|
|
|
$fields = $table['columns']; |
119
|
|
|
|
120
|
|
|
return response()->json(['success' => true, 'fields' => $fields]); |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
return response()->json(['success' => false]); |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
public function create(Request $request) |
127
|
|
|
{ |
128
|
|
|
if ($request->ajax()) { |
129
|
|
|
|
130
|
|
|
$table = json_decode($request->table, true); |
131
|
|
|
|
132
|
|
|
if (($response = DBM::authorize('database.create')) !== true) { |
133
|
|
|
return $response; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
try |
137
|
|
|
{ |
138
|
|
|
Table::create($request->table); |
139
|
|
|
|
140
|
|
|
if (Driver::isMongoDB()) { |
141
|
|
|
$collection = new DBM_Collection; |
142
|
|
|
$collection->name = $table['name']; |
143
|
|
|
$collection->old_name = $table['name']; |
144
|
|
|
$collection->extra = []; |
145
|
|
|
|
146
|
|
|
if ($collection->save()) { |
147
|
|
|
$id = $collection->_id; |
148
|
|
|
|
149
|
|
|
$collection_field = new CollectionField; |
150
|
|
|
|
151
|
|
|
$collection_field->dbm_collection_id = $id; |
152
|
|
|
$collection_field->name = '_id'; |
153
|
|
|
$collection_field->old_name = '_id'; |
154
|
|
|
$collection_field->type = 'ObjectId'; |
155
|
|
|
$collection_field->index = 'PRIMARY_KEY'; |
156
|
|
|
$collection_field->extra = []; |
157
|
|
|
|
158
|
|
|
$collection_field->save(); |
159
|
|
|
} |
160
|
|
|
} |
161
|
|
|
return response()->json(['success' => true]); |
162
|
|
|
} catch (\Exception $e) { |
163
|
|
|
return response()->json([ |
164
|
|
|
'success' => false, |
165
|
|
|
'errors' => [$e->getMessage()], |
166
|
|
|
], 400); |
167
|
|
|
} |
168
|
|
|
} |
169
|
|
|
|
170
|
|
|
return response()->json(['success' => false]); |
171
|
|
|
} |
172
|
|
|
|
173
|
|
|
public function updateTemplates($templates) |
174
|
|
|
{ |
175
|
|
|
if (is_array($templates) && count($templates) > 0) { |
176
|
|
|
|
177
|
|
|
foreach ($templates as $field) { |
178
|
|
|
|
179
|
|
|
if ($template = DBM::Template()->where('old_name', $field['oldName'])->first()) { |
180
|
|
|
|
181
|
|
|
$template->name = $field['name']; |
182
|
|
|
$template->old_name = $field['name']; |
183
|
|
|
$template->type = $field['type']['name']; |
184
|
|
|
$template->length = $field['length']; |
185
|
|
|
$template->index = $field['index']; |
186
|
|
|
$template->default = $field['default']; |
187
|
|
|
$template->notnull = $field['notnull']; |
188
|
|
|
$template->unsigned = $field['unsigned']; |
189
|
|
|
$template->auto_increment = $field['autoincrement']; |
190
|
|
|
|
191
|
|
|
$template->update(); |
192
|
|
|
} |
193
|
|
|
} |
194
|
|
|
} |
195
|
|
|
} |
196
|
|
|
|
197
|
|
|
public function updateMongoDbTable($table) |
198
|
|
|
{ |
199
|
|
|
$tableName = $table['oldName']; |
200
|
|
|
$newName = $table['name']; |
201
|
|
|
$columns = $table['columns']; |
202
|
|
|
|
203
|
|
|
if ($collection = DBM_Collection::where('name', $tableName)->first()) { |
204
|
|
|
if ($tableName != $newName) { |
205
|
|
|
$collection->name = $newName; |
206
|
|
|
$collection->old_name = $newName; |
207
|
|
|
$collection->update(); |
208
|
|
|
} |
209
|
|
|
} else { |
210
|
|
|
$collection = new DBM_Collection; |
211
|
|
|
$collection->name = $newName; |
212
|
|
|
$collection->old_name = $newName; |
213
|
|
|
$collection->save(); |
214
|
|
|
} |
215
|
|
|
|
216
|
|
|
if ($collection) { |
217
|
|
|
|
218
|
|
|
$id = $collection->_id; |
219
|
|
|
$fieldNames = (!empty($collection->fields)) ? $collection->fields->pluck('old_name')->toArray() : []; |
220
|
|
|
|
221
|
|
|
foreach ($columns as $column) { |
222
|
|
|
|
223
|
|
|
if (in_array($column['oldName'], $fieldNames)) { |
224
|
|
|
|
225
|
|
|
$collection_field = CollectionField::where('old_name', $column['oldName'])->first(); |
226
|
|
|
|
227
|
|
|
$collection_field->name = $column['name']; |
228
|
|
|
$collection_field->old_name = $column['oldName']; |
229
|
|
|
$collection_field->type = $column['type']['name']; |
230
|
|
|
$collection_field->update(); |
231
|
|
|
$fieldNames = array_values(array_diff($fieldNames, [$column['oldName']])); |
232
|
|
|
} else { |
233
|
|
|
|
234
|
|
|
$collection_field = new CollectionField; |
235
|
|
|
|
236
|
|
|
$collection_field->dbm_collection_id = $id; |
237
|
|
|
$collection_field->name = $column['name']; |
238
|
|
|
$collection_field->old_name = $column['name']; |
239
|
|
|
$collection_field->type = $column['type']['name']; |
240
|
|
|
$collection_field->index = ''; |
241
|
|
|
$collection_field->extra = []; |
242
|
|
|
|
243
|
|
|
$collection_field->save(); |
244
|
|
|
} |
245
|
|
|
} |
246
|
|
|
|
247
|
|
|
if (count($fieldNames) > 0) { |
248
|
|
|
foreach ($fieldNames as $fieldName) { |
249
|
|
|
$field = CollectionField::where([ |
250
|
|
|
'dbm_collection_id' => $id, |
251
|
|
|
'name' => $fieldName])->first(); |
252
|
|
|
$field->delete(); |
253
|
|
|
} |
254
|
|
|
} |
255
|
|
|
|
256
|
|
|
} |
257
|
|
|
} |
258
|
|
|
|
259
|
|
|
public function addOrUpdateCrudField($object, $column, &$fieldNames) |
260
|
|
|
{ |
261
|
|
|
$columnType = $column['type']; |
262
|
|
|
|
263
|
|
|
if (in_array($column['oldName'], $fieldNames)) { |
264
|
|
|
|
265
|
|
|
$field = DBM::Field()->where([ |
266
|
|
|
'dbm_object_id' => $object->id, |
267
|
|
|
'name' => $column['oldName'], |
268
|
|
|
])->first(); |
269
|
|
|
|
270
|
|
|
$field->name = $column['name']; |
271
|
|
|
if ($column['oldName'] != $column['name']) { |
272
|
|
|
$field->display_name = ucfirst($column['name']); |
273
|
|
|
} |
274
|
|
|
$field->order = $column['order']; |
275
|
|
|
$field->update(); |
276
|
|
|
|
277
|
|
|
$fieldNames = array_values(array_diff($fieldNames, [$column['oldName']])); |
278
|
|
|
} else { |
279
|
|
|
|
280
|
|
|
if (DBM::Field()->where([ |
281
|
|
|
'dbm_object_id' => $object->id, |
282
|
|
|
'name' => $column['name']])->first()) { |
283
|
|
|
return response()->json([ |
284
|
|
|
'success' => false, |
285
|
|
|
'errors' => ["Field name must be unique. " . $column['name'] . " are duplicate"], |
286
|
|
|
], 400); |
287
|
|
|
} |
288
|
|
|
|
289
|
|
|
$field = DBM::Field(); |
290
|
|
|
$field->dbm_object_id = $object->id; |
291
|
|
|
$field->name = $column['name']; |
292
|
|
|
$field->display_name = ucfirst($column['name']); |
293
|
|
|
$field->type = static::getInputType($columnType['name']); |
294
|
|
|
$field->order = $column['order']; |
295
|
|
|
|
296
|
|
|
if ($column['autoincrement'] == true) { |
297
|
|
|
$field->create = false; |
298
|
|
|
$field->read = false; |
299
|
|
|
$field->edit = false; |
300
|
|
|
$field->delete = false; |
301
|
|
|
} |
302
|
|
|
|
303
|
|
|
$field->save(); |
304
|
|
|
} |
305
|
|
|
} |
306
|
|
|
|
307
|
|
|
public function updateCrudFields($table) |
308
|
|
|
{ |
309
|
|
|
$tableName = $table['oldName']; |
310
|
|
|
$newName = $table['name']; |
311
|
|
|
$columns = $table['columns']; |
312
|
|
|
|
313
|
|
|
if ($tableName != $newName) { |
314
|
|
|
|
315
|
|
|
DBM::Object()->where('slug', Str::slug($tableName))->update([ |
316
|
|
|
'name' => $newName, |
317
|
|
|
'slug' => Str::slug($newName), |
318
|
|
|
'display_name' => ucfirst($newName), |
319
|
|
|
]); |
320
|
|
|
|
321
|
|
|
$tableName = $newName; |
322
|
|
|
} |
323
|
|
|
|
324
|
|
|
if ($object = DBM::Object()::where('slug', Str::slug($tableName))->first()) { |
325
|
|
|
|
326
|
|
|
$fieldNames = $object->fields->pluck('name')->toArray(); |
327
|
|
|
// $relationshipItems = []; |
328
|
|
|
|
329
|
|
|
foreach ($columns as $column) { |
330
|
|
|
|
331
|
|
|
$this->addOrUpdateCrudField($object, $column, $fieldNames); |
332
|
|
|
|
333
|
|
|
} |
334
|
|
|
|
335
|
|
|
if (count($fieldNames) > 0) { |
336
|
|
|
foreach ($fieldNames as $fieldName) { |
337
|
|
|
$field = DBM::Field()->where([ |
338
|
|
|
'dbm_object_id' => $object->id, |
339
|
|
|
'name' => $fieldName])->first(); |
340
|
|
|
if ($field->type != 'relationship') { |
341
|
|
|
$field->delete(); |
342
|
|
|
} |
343
|
|
|
} |
344
|
|
|
} |
345
|
|
|
} |
346
|
|
|
} |
347
|
|
|
|
348
|
|
|
public function update(Request $request) |
349
|
|
|
{ |
350
|
|
|
if ($request->ajax()) { |
351
|
|
|
|
352
|
|
|
if (($response = DBM::authorize('database.update')) !== true) { |
353
|
|
|
return $response; |
354
|
|
|
} |
355
|
|
|
|
356
|
|
|
$table = $request->table; |
357
|
|
|
|
358
|
|
|
if (!is_array($table)) { |
359
|
|
|
$table = json_decode($table, true); |
360
|
|
|
} |
361
|
|
|
|
362
|
|
|
$tableName = $table['oldName']; |
363
|
|
|
|
364
|
|
|
try |
365
|
|
|
{ |
366
|
|
|
// Update Template |
367
|
|
|
$this->updateTemplates($request->templates); |
368
|
|
|
|
369
|
|
|
if (Table::exists($tableName)) { |
370
|
|
|
|
371
|
|
|
if (Driver::isMongoDB()) { |
372
|
|
|
|
373
|
|
|
$this->updateMongoDbTable($table); |
374
|
|
|
} |
375
|
|
|
|
376
|
|
|
// Update Database |
377
|
|
|
Table::update($request->table); |
378
|
|
|
|
379
|
|
|
// Update Crud fields |
380
|
|
|
$this->updateCrudFields($table); |
381
|
|
|
|
382
|
|
|
return response()->json(['success' => true]); |
383
|
|
|
} |
384
|
|
|
|
385
|
|
|
} catch (\Exception $e) { |
386
|
|
|
|
387
|
|
|
return response()->json([ |
388
|
|
|
'success' => false, |
389
|
|
|
'errors' => [$e->getMessage()], |
390
|
|
|
], 400); |
391
|
|
|
} |
392
|
|
|
} |
393
|
|
|
|
394
|
|
|
return response()->json(['success' => false]); |
395
|
|
|
|
396
|
|
|
} |
397
|
|
|
|
398
|
|
|
public function delete(Request $request) |
399
|
|
|
{ |
400
|
|
|
if ($request->ajax()) { |
401
|
|
|
|
402
|
|
|
if (($response = DBM::authorize('database.delete')) !== true) { |
403
|
|
|
return $response; |
404
|
|
|
} |
405
|
|
|
|
406
|
|
|
$tableName = $request->table; |
407
|
|
|
|
408
|
|
|
try |
409
|
|
|
{ |
410
|
|
|
if (Table::exists($tableName)) { |
411
|
|
|
|
412
|
|
|
if (Driver::isMongoDB()) { |
413
|
|
|
if ($collection = DBM_Collection::where('name', $tableName)->first()) { |
414
|
|
|
$collection->fields()->delete(); |
415
|
|
|
$collection->delete(); |
416
|
|
|
} |
417
|
|
|
} |
418
|
|
|
|
419
|
|
|
if ($object = DBM::Object()->where('slug', Str::slug($tableName))->first()) { |
420
|
|
|
|
421
|
|
|
$object->fields()->delete(); |
422
|
|
|
$object->delete(); |
423
|
|
|
} |
424
|
|
|
|
425
|
|
|
Table::drop($tableName); |
426
|
|
|
|
427
|
|
|
return response()->json(['success' => true]); |
428
|
|
|
} |
429
|
|
|
|
430
|
|
|
} catch (\Exception $e) { |
431
|
|
|
|
432
|
|
|
return response()->json([ |
433
|
|
|
'success' => false, |
434
|
|
|
'errors' => [$e->getMessage()], |
435
|
|
|
], 400); |
436
|
|
|
} |
437
|
|
|
} |
438
|
|
|
|
439
|
|
|
return response()->json(['success' => false]); |
440
|
|
|
} |
441
|
|
|
|
442
|
|
|
public static function getInputType($name) |
443
|
|
|
{ |
444
|
|
|
$types = static::inputTypes(); |
445
|
|
|
foreach ($types as $type => $value) { |
446
|
|
|
if (in_array($name, $value)) { |
447
|
|
|
return $type; |
448
|
|
|
} |
449
|
|
|
} |
450
|
|
|
return 'text'; |
451
|
|
|
} |
452
|
|
|
|
453
|
|
|
public static function inputTypes() |
454
|
|
|
{ |
455
|
|
|
return [ |
456
|
|
|
'number' => [ |
457
|
|
|
'tinyint', |
458
|
|
|
'smallint', |
459
|
|
|
'mediumint', |
460
|
|
|
'integer', |
461
|
|
|
'int', |
462
|
|
|
'bigint', |
463
|
|
|
'decimal', |
464
|
|
|
'numeric', |
465
|
|
|
], |
466
|
|
|
'text' => [ |
467
|
|
|
'money', |
468
|
|
|
'float', |
469
|
|
|
'real', |
470
|
|
|
'double', |
471
|
|
|
'double precision', |
472
|
|
|
// String |
473
|
|
|
'char', |
474
|
|
|
'character', |
475
|
|
|
'varchar', |
476
|
|
|
'character varying', |
477
|
|
|
'string', |
478
|
|
|
'guid', |
479
|
|
|
'uuid', |
480
|
|
|
// Lists |
481
|
|
|
'json', |
482
|
|
|
'jsonb', |
483
|
|
|
'json_array', |
484
|
|
|
], |
485
|
|
|
'password' => [ |
486
|
|
|
'password', |
487
|
|
|
], |
488
|
|
|
'email' => [], |
489
|
|
|
'select' => [], |
490
|
|
|
'radio' => [], |
491
|
|
|
'checkbox' => [ |
492
|
|
|
'boolean', |
493
|
|
|
], |
494
|
|
|
'textarea' => [ |
495
|
|
|
'tinytext', |
496
|
|
|
'text', |
497
|
|
|
'mediumtext', |
498
|
|
|
'longtext', |
499
|
|
|
'tsquery', |
500
|
|
|
'tsvector', |
501
|
|
|
'xml', |
502
|
|
|
], |
503
|
|
|
'date' => [ |
504
|
|
|
'date', |
505
|
|
|
'datetime', |
506
|
|
|
'year', |
507
|
|
|
'timetz', |
508
|
|
|
'timestamptz', |
509
|
|
|
'datetimetz', |
510
|
|
|
'dateinterval', |
511
|
|
|
'interval', |
512
|
|
|
], |
513
|
|
|
'timestamp' => [ |
514
|
|
|
'timestamp', |
515
|
|
|
], |
516
|
|
|
'color' => [], |
517
|
|
|
'file' => [], |
518
|
|
|
'image' => [], |
519
|
|
|
'hidden' => [], |
520
|
|
|
'month' => [], |
521
|
|
|
'week' => [], |
522
|
|
|
'time' => [ |
523
|
|
|
'time', |
524
|
|
|
], |
525
|
|
|
'url' => [], |
526
|
|
|
'tel' => [], |
527
|
|
|
'submit' => [], |
528
|
|
|
'search' => [], |
529
|
|
|
]; |
530
|
|
|
} |
531
|
|
|
|
532
|
|
|
/* |
533
|
|
|
* Store Template |
534
|
|
|
*/ |
535
|
|
|
public function saveTemplate(Request $request) |
536
|
|
|
{ |
537
|
|
|
$field = $request->template; |
538
|
|
|
try |
539
|
|
|
{ |
540
|
|
|
if (DBM::Template()->where('name', $field['name'])->first()) { |
541
|
|
|
return response()->json([ |
542
|
|
|
'success' => false, |
543
|
|
|
'errors' => [" The template name must be unique. " . $field['name'] . " already exist."], |
544
|
|
|
], 400); |
545
|
|
|
} |
546
|
|
|
|
547
|
|
|
$template = DBM::Template(); |
548
|
|
|
$template->name = $field['name']; |
549
|
|
|
$template->old_name = $field['name']; |
550
|
|
|
$template->type = $field['type']['name']; |
551
|
|
|
$template->length = $field['length']; |
552
|
|
|
$template->index = $field['index']; |
553
|
|
|
$template->default = $field['default']; |
554
|
|
|
$template->notnull = $field['notnull']; |
555
|
|
|
$template->unsigned = $field['unsigned']; |
556
|
|
|
$template->auto_increment = $field['autoincrement']; |
557
|
|
|
|
558
|
|
|
if ($template->save()) { |
559
|
|
|
return response()->json(['success' => true, 'templates' => DBM::templates()]); |
560
|
|
|
} |
561
|
|
|
|
562
|
|
|
} catch (\Exception $e) { |
563
|
|
|
return response()->json([ |
564
|
|
|
'success' => false, |
565
|
|
|
'errors' => [$e->getMessage()], |
566
|
|
|
], 400); |
567
|
|
|
} |
568
|
|
|
return response()->json(['success' => true, 'template' => $request->all()]); |
569
|
|
|
} |
570
|
|
|
|
571
|
|
|
public function removeTemplate(Request $request) |
572
|
|
|
{ |
573
|
|
|
if ($template = DBM::Template()->where('name', $request->name)->first()) { |
574
|
|
|
if ($template->delete()) { |
575
|
|
|
return response()->json(['success' => true, 'templates' => DBM::templates()]); |
576
|
|
|
} |
577
|
|
|
} |
578
|
|
|
return response()->json([ |
579
|
|
|
'success' => false, |
580
|
|
|
'errors' => ['The template '+$request->name . " not found"], |
581
|
|
|
], 400); |
582
|
|
|
} |
583
|
|
|
|
584
|
|
|
public function getUniqueId() |
585
|
|
|
{ |
586
|
|
|
$id = new \MongoDB\BSON\ObjectId(); |
587
|
|
|
foreach ($id as $key => $value) { |
588
|
|
|
return response()->json(['success' => true, 'id' => $value]); |
589
|
|
|
} |
590
|
|
|
} |
591
|
|
|
|
592
|
|
|
} |
593
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths