@@ -82,7 +82,7 @@ |
||
| 82 | 82 | $indexType = $indexDetails['type']; |
| 83 | 83 | $options = $indexDetails['options']; |
| 84 | 84 | |
| 85 | - $options['name'] = strtolower($collection->getCollectionName() . '_' . $column . '_' . $type); |
|
| 85 | + $options['name'] = strtolower($collection->getCollectionName().'_'.$column.'_'.$type); |
|
| 86 | 86 | |
| 87 | 87 | $options['ns'] = $collection->getNamespace(); |
| 88 | 88 | |
@@ -54,13 +54,13 @@ |
||
| 54 | 54 | */ |
| 55 | 55 | protected static function getCustomTypes($platformName) |
| 56 | 56 | { |
| 57 | - $customPlatformDir = __DIR__ . DIRECTORY_SEPARATOR . $platformName . DIRECTORY_SEPARATOR; |
|
| 57 | + $customPlatformDir = __DIR__.DIRECTORY_SEPARATOR.$platformName.DIRECTORY_SEPARATOR; |
|
| 58 | 58 | |
| 59 | 59 | $customTypes = []; |
| 60 | 60 | |
| 61 | - foreach (glob($customPlatformDir . '*.php') as $file) { |
|
| 61 | + foreach (glob($customPlatformDir.'*.php') as $file) { |
|
| 62 | 62 | $className = basename($file, ".php"); |
| 63 | - $customTypes[] = __NAMESPACE__ . '\\' . $platformName . '\\' . $className; |
|
| 63 | + $customTypes[] = __NAMESPACE__.'\\'.$platformName.'\\'.$className; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | return $customTypes; |
@@ -151,11 +151,11 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | Type::registerCustomTypes(); |
| 153 | 153 | |
| 154 | - $conn = 'database.connections.' . config('database.default'); |
|
| 154 | + $conn = 'database.connections.'.config('database.default'); |
|
| 155 | 155 | |
| 156 | - $table['options']['collate'] = $table['options']['collation'] ?? config($conn . '.collation', 'utf8mb4_unicode_ci'); |
|
| 156 | + $table['options']['collate'] = $table['options']['collation'] ?? config($conn.'.collation', 'utf8mb4_unicode_ci'); |
|
| 157 | 157 | if (Driver::isMysql()) { |
| 158 | - $table['options']['charset'] = $table['options']['charset'] ?? config($conn . '.charset', 'utf8mb4'); |
|
| 158 | + $table['options']['charset'] = $table['options']['charset'] ?? config($conn.'.charset', 'utf8mb4'); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | $tableName = $table['name']; |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | $items = static::all(); |
| 280 | 280 | $collection = $items instanceof Collection ? $items : Collection::make($items); |
| 281 | 281 | if (!empty($query)) { |
| 282 | - $collection = $collection->filter(function ($value, $key) use ($query) { |
|
| 282 | + $collection = $collection->filter(function($value, $key) use ($query) { |
|
| 283 | 283 | return false !== stristr($value, $query); |
| 284 | 284 | }); |
| 285 | 285 | } |
@@ -56,9 +56,9 @@ |
||
| 56 | 56 | */ |
| 57 | 57 | public static function createName($columns, $type, $table = null) |
| 58 | 58 | { |
| 59 | - $table = isset($table) ? trim($table) . '_' : ''; |
|
| 59 | + $table = isset($table) ? trim($table).'_' : ''; |
|
| 60 | 60 | $type = trim($type); |
| 61 | - $name = strtolower($table . implode('_', $columns) . '_' . $type); |
|
| 61 | + $name = strtolower($table.implode('_', $columns).'_'.$type); |
|
| 62 | 62 | |
| 63 | 63 | return str_replace(['-', '.'], '_', $name); |
| 64 | 64 | } |
@@ -178,7 +178,7 @@ |
||
| 178 | 178 | 'name' => $column['name']])->first()) { |
| 179 | 179 | return response()->json([ |
| 180 | 180 | 'success' => false, |
| 181 | - 'errors' => ["Field name must be unique. " . $column['name'] . " are duplicate"], |
|
| 181 | + 'errors' => ["Field name must be unique. ".$column['name']." are duplicate"], |
|
| 182 | 182 | ], 400); |
| 183 | 183 | } |
| 184 | 184 | |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | $prefix = (Driver::isMongoDB()) ? "_" : ""; |
| 48 | 48 | |
| 49 | 49 | foreach ($fields as $fld) { |
| 50 | - if ($fld->id == $field->{$prefix . "id"}) { |
|
| 50 | + if ($fld->id == $field->{$prefix."id"}) { |
|
| 51 | 51 | |
| 52 | 52 | $relationship = $fld->settings; |
| 53 | 53 | $localTable = $relationship['localTable']; |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | $columns = $request->fields; |
| 33 | 33 | $permission = $request->isCrudExists ? 'update' : 'create'; |
| 34 | 34 | |
| 35 | - if (($response = DBM::authorize('crud.' . $permission)) !== true) { |
|
| 35 | + if (($response = DBM::authorize('crud.'.$permission)) !== true) { |
|
| 36 | 36 | return $response; |
| 37 | 37 | } |
| 38 | 38 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | if (DBM::Template()->where('name', $field['name'])->first()) { |
| 49 | 49 | return response()->json([ |
| 50 | 50 | 'success' => false, |
| 51 | - 'errors' => [" The template name must be unique. " . $field['name'] . " already exist."], |
|
| 51 | + 'errors' => [" The template name must be unique. ".$field['name']." already exist."], |
|
| 52 | 52 | ], 400); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | } |
| 90 | 90 | return response()->json([ |
| 91 | 91 | 'success' => false, |
| 92 | - 'errors' => ['The template '+$request->name . " not found"], |
|
| 92 | + 'errors' => ['The template '+$request->name." not found"], |
|
| 93 | 93 | ], 400); |
| 94 | 94 | } |
| 95 | 95 | } |
@@ -62,12 +62,12 @@ |
||
| 62 | 62 | public function getPaginateFiles(Request $request) |
| 63 | 63 | { |
| 64 | 64 | $driver = dbm_driver(); |
| 65 | - $directory = 'backups' . DIRECTORY_SEPARATOR . $driver; |
|
| 65 | + $directory = 'backups'.DIRECTORY_SEPARATOR.$driver; |
|
| 66 | 66 | $files = collect(Storage::allFiles($directory)); |
| 67 | 67 | |
| 68 | 68 | $query = $request->q; |
| 69 | 69 | if (!empty($query)) { |
| 70 | - $files = $files->filter(function ($file) use ($query) { |
|
| 70 | + $files = $files->filter(function($file) use ($query) { |
|
| 71 | 71 | $info = pathinfo($file); |
| 72 | 72 | return false !== stristr($info['basename'], $query); |
| 73 | 73 | }); |