@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('menus', function (Blueprint $table) { |
|
16 | + Schema::create('menus', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->string('name'); |
19 | 19 | $table->string('slug'); |
@@ -78,13 +78,13 @@ discard block |
||
78 | 78 | switch ($data['driver']) { |
79 | 79 | case 'mysql': |
80 | 80 | case 'pgsql': |
81 | - if (! empty($data['table'])) { |
|
81 | + if (!empty($data['table'])) { |
|
82 | 82 | $dumper->setTables($data['table']); |
83 | 83 | } |
84 | 84 | break; |
85 | 85 | case 'mongodb': |
86 | 86 | $dsn = config('dbm.backup.mongodb.dsn', ''); |
87 | - if (! empty($dsn) && method_exists($dumper, 'setUri')) { |
|
87 | + if (!empty($dsn) && method_exists($dumper, 'setUri')) { |
|
88 | 88 | $dumper->setUri($dsn); |
89 | 89 | } |
90 | 90 | break; |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $directoryPath = storage_path('app').$directory.DIRECTORY_SEPARATOR.$driver; |
127 | 127 | $filePath = $directoryPath.DIRECTORY_SEPARATOR.$this->getFileName($table, $database); |
128 | 128 | |
129 | - if (! File::isDirectory($directoryPath)) { |
|
129 | + if (!File::isDirectory($directoryPath)) { |
|
130 | 130 | File::makeDirectory($directoryPath, 0777, true, true); |
131 | 131 | } |
132 | 132 |
@@ -103,7 +103,7 @@ |
||
103 | 103 | // Seeding Dummy Data |
104 | 104 | $class = 'DatabaseManagerSeeder'; |
105 | 105 | $file = $this->seedersPath.$class.'.php'; |
106 | - if (file_exists($file) && ! class_exists($class)) { |
|
106 | + if (file_exists($file) && !class_exists($class)) { |
|
107 | 107 | require_once $file; |
108 | 108 | } |
109 | 109 | with(new $class())->run(); |
@@ -90,7 +90,7 @@ |
||
90 | 90 | switch ($driver) { |
91 | 91 | case 'mongodb': |
92 | 92 | $dsn = config('dbm.backup.mongodb.dsn', ''); |
93 | - if (! empty($dsn)) { |
|
93 | + if (!empty($dsn)) { |
|
94 | 94 | $dumper->setUri($dsn); |
95 | 95 | } |
96 | 96 | break; |
@@ -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'); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | Route::put('/relationship', 'RelationController@update'); |
45 | 45 | Route::delete('/relationship', 'RelationController@delete'); |
46 | 46 | // Table |
47 | - Route::group(['prefix' => 'table'], function () { |
|
47 | + Route::group(['prefix' => 'table'], function() { |
|
48 | 48 | Route::get('/details/{table}', 'RecordController@getTableDetails'); |
49 | 49 | Route::get('/columns/{table}', 'TableController@getTableColumns'); |
50 | 50 | }); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | Route::group([ |
58 | 58 | 'prefix' => 'database', |
59 | 59 | 'namespace' => config('dbm.controller_namespace'), |
60 | -], function () { |
|
60 | +], function() { |
|
61 | 61 | // User |
62 | 62 | Route::post('/login', 'UserController@login'); |
63 | 63 |
@@ -1,34 +1,34 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('dbm_asset')) { |
|
3 | +if (!function_exists('dbm_asset')) { |
|
4 | 4 | function dbm_asset($path, $secure = null) |
5 | 5 | { |
6 | 6 | return route('dbm.asset').'?path='.urlencode($path); |
7 | 7 | } |
8 | 8 | } |
9 | 9 | |
10 | -if (! function_exists('dbm_driver')) { |
|
10 | +if (!function_exists('dbm_driver')) { |
|
11 | 11 | function dbm_driver() |
12 | 12 | { |
13 | 13 | return (config('database.default') != '') ? config('database.default') : 'mysql'; |
14 | 14 | } |
15 | 15 | } |
16 | 16 | |
17 | -if (! function_exists('dbm_prefix')) { |
|
17 | +if (!function_exists('dbm_prefix')) { |
|
18 | 18 | function dbm_prefix() |
19 | 19 | { |
20 | 20 | return (config('dbm.prefix') != '') ? config('dbm.prefix') : ''; |
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
24 | -if (! function_exists('is_json')) { |
|
24 | +if (!function_exists('is_json')) { |
|
25 | 25 | function is_json($string) |
26 | 26 | { |
27 | 27 | return is_string($string) && is_array(json_decode($string, true)) && (json_last_error() == JSON_ERROR_NONE) ? true : false; |
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
31 | -if (! function_exists('save_json')) { |
|
31 | +if (!function_exists('save_json')) { |
|
32 | 32 | function save_json(array $arr) |
33 | 33 | { |
34 | 34 | $jsonArr = []; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | -if (! function_exists('retreive_json')) { |
|
44 | +if (!function_exists('retreive_json')) { |
|
45 | 45 | function retreive_json(string $str) |
46 | 46 | { |
47 | 47 | $jsonData = json_decode($str, true); |
@@ -41,7 +41,7 @@ |
||
41 | 41 | { |
42 | 42 | $database = $this->app->config['database']; |
43 | 43 | // Bind Dumper to backup and and restore |
44 | - $this->app->bind(Dumper::class, function ($app) use ($database) { |
|
44 | + $this->app->bind(Dumper::class, function($app) use ($database) { |
|
45 | 45 | $connection = $database['default']; |
46 | 46 | $options = [ |
47 | 47 | 'host' => $database['connections'][$connection]['host'] ?? '', |
@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function __construct() |
21 | 21 | { |
22 | - if (! self::$connection = DB::connection()->getMongoClient()) { |
|
22 | + if (!self::$connection = DB::connection()->getMongoClient()) { |
|
23 | 23 | $host = config('database.connections.mongodb.host'); |
24 | 24 | $port = config('database.connections.mongodb.port'); |
25 | 25 | $options = config('database.connections.mongodb.options'); |
26 | 26 | $auth_db = config('database.connections.mongodb.options.database') ? config('database.connections.mongodb.options.database') : null; |
27 | 27 | $dsn = config('database.connections.mongodb.dsn'); |
28 | 28 | |
29 | - if (! $dsn) { |
|
29 | + if (!$dsn) { |
|
30 | 30 | $dsn = 'mongodb://'.$host.':'.$port.($auth_db ? '/'.$auth_db : ''); |
31 | 31 | } |
32 | 32 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function getMongoClient() |
45 | 45 | { |
46 | - if (! self::$connection) { |
|
46 | + if (!self::$connection) { |
|
47 | 47 | new self(); |
48 | 48 | } |
49 | 49 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | if (count($values) > 1) { |
52 | 52 | $value = $values; |
53 | - if (! Driver::isMongoDB()) { |
|
53 | + if (!Driver::isMongoDB()) { |
|
54 | 54 | $value = json_encode($values); |
55 | 55 | } |
56 | 56 | } elseif (count($values) == 1) { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | if (Driver::isMongoDB()) { |
77 | 77 | $fieldType = $this->getFieldType($tableName, $column); |
78 | 78 | |
79 | - if (! in_array($fieldType, Type::getTypes())) { |
|
79 | + if (!in_array($fieldType, Type::getTypes())) { |
|
80 | 80 | $this->generateError([$fieldType.' type not supported.']); |
81 | 81 | } |
82 | 82 |