@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | $modelName = ucfirst(Str::singular($object->name)); |
95 | 95 | |
96 | - $model = $namespace . '\\' . $modelName; |
|
96 | + $model = $namespace.'\\'.$modelName; |
|
97 | 97 | $object->model = $model; |
98 | 98 | } else { |
99 | 99 | $model = $object->model; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $table = Table::getTable($tableName); |
108 | 108 | |
109 | 109 | $modelName = ucfirst(Str::singular($table['name'])); |
110 | - $model = $namespace . '\\' . $modelName; |
|
110 | + $model = $namespace.'\\'.$modelName; |
|
111 | 111 | |
112 | 112 | $object = new \stdClass; |
113 | 113 | $object->name = $table['name']; |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | } else if ($table['makeModel'] == false && !class_exists($table['model'])) { |
206 | 206 | return response()->json([ |
207 | 207 | 'success' => false, |
208 | - 'errors' => ["Create model '" . $table['model'] . "' first or checked create model option"], |
|
208 | + 'errors' => ["Create model '".$table['model']."' first or checked create model option"], |
|
209 | 209 | ], 400); |
210 | 210 | } |
211 | 211 | |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | if ($table['makeModel'] == true) { |
272 | 272 | \DBM::makeModel($table['model'], $table['name']); |
273 | 273 | } else if ($table['makeModel'] == false && !class_exists($table['model'])) { |
274 | - return $this->generateError(["Create mode '" . $table['model'] . "' first."]); |
|
274 | + return $this->generateError(["Create mode '".$table['model']."' first."]); |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | if (!class_exists($table['controller'])) { |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | $prefix = (Driver::isMongoDB()) ? "_" : ""; |
370 | 370 | |
371 | 371 | foreach ($fields as $fld) { |
372 | - if ($fld->id == $field->{$prefix . "id"}) { |
|
372 | + if ($fld->id == $field->{$prefix."id"}) { |
|
373 | 373 | |
374 | 374 | $relationship = $fld->settings; |
375 | 375 | $localTable = $relationship['localTable']; |
@@ -403,17 +403,17 @@ discard block |
||
403 | 403 | |
404 | 404 | if (!class_exists($relationship['localModel'])) { |
405 | 405 | |
406 | - $error = $relationship['localModel'] . " Model not found. Please create the " . $relationship['localModel'] . " model first"; |
|
406 | + $error = $relationship['localModel']." Model not found. Please create the ".$relationship['localModel']." model first"; |
|
407 | 407 | return $this->generateError([$error]); |
408 | 408 | } |
409 | 409 | |
410 | 410 | if (!class_exists($relationship['foreignModel'])) { |
411 | 411 | |
412 | - $error = $relationship['foreignModel'] . " Model not found. Please create the " . $relationship['foreignModel'] . " model first"; |
|
412 | + $error = $relationship['foreignModel']." Model not found. Please create the ".$relationship['foreignModel']." model first"; |
|
413 | 413 | return $this->generateError([$error]); |
414 | 414 | } |
415 | 415 | |
416 | - $fieldName = strtolower(Str::singular($relationship['localTable']) . '_' . $relationship['type'] . '_' . Str::singular($relationship['foreignTable']) . '_relationship'); |
|
416 | + $fieldName = strtolower(Str::singular($relationship['localTable']).'_'.$relationship['type'].'_'.Str::singular($relationship['foreignTable']).'_relationship'); |
|
417 | 417 | $settings = [ |
418 | 418 | 'relationType' => $relationship['type'], |
419 | 419 | 'localModel' => $relationship['localModel'], |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | $files = $request->file($column); |
62 | 62 | $values = []; |
63 | 63 | foreach ($files as $file) { |
64 | - $fileName = Str::random(config('dbm.filesystem.random_length')) . '.' . $file->getClientOriginalExtension(); |
|
65 | - $path = 'public/dbm/' . $tableName; |
|
64 | + $fileName = Str::random(config('dbm.filesystem.random_length')).'.'.$file->getClientOriginalExtension(); |
|
65 | + $path = 'public/dbm/'.$tableName; |
|
66 | 66 | $file->storeAs($path, $fileName); |
67 | 67 | $values[] = $fileName; |
68 | 68 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $fieldType = $this->getFieldType($tableName, $column); |
95 | 95 | |
96 | 96 | if (!in_array($fieldType, Type::getTypes())) { |
97 | - $this->generateError([$fieldType . " type not supported."]); |
|
97 | + $this->generateError([$fieldType." type not supported."]); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | $table->{$column} = Type::$fieldType($value); |
@@ -235,8 +235,8 @@ discard block |
||
235 | 235 | $files = $request->file($column); |
236 | 236 | $values = []; |
237 | 237 | foreach ($files as $file) { |
238 | - $fileName = Str::random(config('dbm.filesystem.random_length')) . '.' . $file->getClientOriginalExtension(); |
|
239 | - $path = 'public/dbm/' . $tableName; |
|
238 | + $fileName = Str::random(config('dbm.filesystem.random_length')).'.'.$file->getClientOriginalExtension(); |
|
239 | + $path = 'public/dbm/'.$tableName; |
|
240 | 240 | $file->storeAs($path, $fileName); |
241 | 241 | $values[] = $fileName; |
242 | 242 | } |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | $fieldType = $this->getFieldType($tableName, $column); |
270 | 270 | |
271 | 271 | if (!in_array($fieldType, Type::getTypes())) { |
272 | - $this->generateError([$fieldType . " type not supported."]); |
|
272 | + $this->generateError([$fieldType." type not supported."]); |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | $table->{$column} = Type::$fieldType($value); |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | |
535 | 535 | if (!empty($query) && !empty($searchColumn)) { |
536 | 536 | $records = DBM::model($model, $tableName) |
537 | - ->where($searchColumn, 'LIKE', '%' . $query . '%') |
|
537 | + ->where($searchColumn, 'LIKE', '%'.$query.'%') |
|
538 | 538 | ->paginate($perPage); |
539 | 539 | } |
540 | 540 | |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | } else if ($action == 'update' && isset($validationSettings->update)) { |
671 | 671 | $updateSettings = $validationSettings->update; |
672 | 672 | $localKey = $updateSettings->localKey; |
673 | - $rules = $updateSettings->rules . ',' . $columns->{$localKey}; |
|
673 | + $rules = $updateSettings->rules.','.$columns->{$localKey}; |
|
674 | 674 | } else if (isset($field->settings->validation) && is_string($validationSettings)) { |
675 | 675 | $rules = $validationSettings; |
676 | 676 | } else { |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | 'prefix' => 'database', |
5 | 5 | 'middleware' => 'auth:api', |
6 | 6 | 'namespace' => config('dbm.controller_namespace'), |
7 | -], function () { |
|
7 | +], function() { |
|
8 | 8 | |
9 | 9 | // Helpers Route |
10 | 10 | Route::get('assets', 'ManagerController@assets')->name('dbm.asset'); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | Route::put('/relationship', 'CrudController@updateRelation'); |
47 | 47 | Route::delete('/relationship', 'CrudController@deleteRelation'); |
48 | 48 | // Table |
49 | - Route::group(['prefix' => 'table'], function () { |
|
49 | + Route::group(['prefix' => 'table'], function() { |
|
50 | 50 | Route::get('/details/{table}', 'RecordController@getTableDetails'); |
51 | 51 | Route::get('/columns/{table}', 'DatabaseController@getTableColumns'); |
52 | 52 | }); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | Route::group([ |
62 | 62 | 'prefix' => 'database', |
63 | 63 | 'namespace' => config('dbm.controller_namespace'), |
64 | -], function () { |
|
64 | +], function() { |
|
65 | 65 | // User |
66 | 66 | Route::post('/login', 'UserController@login'); |
67 | 67 | Route::post('/oauth/token', 'UserController@getPersonalAccessToken'); |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -Route::group(['prefix' => 'database', 'namespace' => config('dbm.controller_namespace')], function () { |
|
2 | +Route::group(['prefix' => 'database', 'namespace' => config('dbm.controller_namespace')], function() { |
|
3 | 3 | //Database Table |
4 | 4 | Route::get('/', 'DatabaseController@index'); |
5 | 5 | Route::get('table/builder/{name}', 'DatabaseController@index'); |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -Route::group(['prefix' => config('dbm.prefix'), 'namespace' => config('dbm.controller_namespace')], function () { |
|
3 | +Route::group(['prefix' => config('dbm.prefix'), 'namespace' => config('dbm.controller_namespace')], function() { |
|
4 | 4 | |
5 | 5 | /* Helpers Route*/ |
6 | 6 | Route::get('assets', 'ManagerController@assets')->name('dbm.asset'); |
7 | 7 | |
8 | 8 | // Database |
9 | - Route::group(['prefix' => 'database', 'middleware' => 'auth:api'], function () { |
|
9 | + Route::group(['prefix' => 'database', 'middleware' => 'auth:api'], function() { |
|
10 | 10 | |
11 | 11 | // Route::get('/', 'DatabaseController@index')->name('dbm.table'); |
12 | 12 | Route::get('/tables', 'DatabaseController@all'); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * U = Update/Edit |
44 | 44 | * D = Delete |
45 | 45 | */ |
46 | - Route::group(['prefix' => 'crud', 'middleware' => 'auth:api'], function () { |
|
46 | + Route::group(['prefix' => 'crud', 'middleware' => 'auth:api'], function() { |
|
47 | 47 | |
48 | 48 | // Route::get('/', 'CrudController@index')->name('dbm.crud'); |
49 | 49 | Route::get('/tables', 'CrudController@all'); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | }); |
62 | 62 | |
63 | - Route::group(['prefix' => 'table', 'middleware' => 'auth:api'], function () { |
|
63 | + Route::group(['prefix' => 'table', 'middleware' => 'auth:api'], function() { |
|
64 | 64 | |
65 | 65 | // Builder |
66 | 66 | // Route::get('/builder/{name}', 'DatabaseController@showTableBuilder'); |