@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | 'name' => $column['name']])->first()) { |
363 | 363 | return response()->json([ |
364 | 364 | 'success' => false, |
365 | - 'errors' => ["Field name must be unique. " . $column['name'] . " are duplicate"], |
|
365 | + 'errors' => ["Field name must be unique. ".$column['name']." are duplicate"], |
|
366 | 366 | ], 400); |
367 | 367 | } |
368 | 368 | |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | if (DBM::Template()->where('name', $field['name'])->first()) { |
559 | 559 | return response()->json([ |
560 | 560 | 'success' => false, |
561 | - 'errors' => [" The template name must be unique. " . $field['name'] . " already exist."], |
|
561 | + 'errors' => [" The template name must be unique. ".$field['name']." already exist."], |
|
562 | 562 | ], 400); |
563 | 563 | } |
564 | 564 | |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | } |
596 | 596 | return response()->json([ |
597 | 597 | 'success' => false, |
598 | - 'errors' => ['The template '+$request->name . " not found"], |
|
598 | + 'errors' => ['The template '+$request->name." not found"], |
|
599 | 599 | ], 400); |
600 | 600 | } |
601 | 601 |
@@ -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 { |
@@ -53,9 +53,9 @@ |
||
53 | 53 | |
54 | 54 | public static function createName(array $columns, $type, $table = null) |
55 | 55 | { |
56 | - $table = isset($table) ? trim($table) . '_' : ''; |
|
56 | + $table = isset($table) ? trim($table).'_' : ''; |
|
57 | 57 | $type = trim($type); |
58 | - $name = strtolower($table . implode('_', $columns) . '_' . $type); |
|
58 | + $name = strtolower($table.implode('_', $columns).'_'.$type); |
|
59 | 59 | |
60 | 60 | return str_replace(['-', '.'], '_', $name); |
61 | 61 | } |