@@ -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'); |
@@ -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 | } |