@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | { |
83 | 83 | if ($request->ajax()) { |
84 | 84 | try { |
85 | - if (! Table::exists($request->table)) { |
|
85 | + if (!Table::exists($request->table)) { |
|
86 | 86 | throw new \Exception('Sorry! There is no table', 1); |
87 | 87 | } |
88 | 88 | |
@@ -128,13 +128,13 @@ discard block |
||
128 | 128 | |
129 | 129 | if ($object = DBM::Object()->where('name', $tableName)->first()) { |
130 | 130 | $isCrudExists = true; |
131 | - if (! $object->model) { |
|
131 | + if (!$object->model) { |
|
132 | 132 | $object->model = DBM::generateModelName($object->name); |
133 | 133 | } |
134 | 134 | $fields = $object->fields()->orderBy('order', 'ASC')->get(); |
135 | 135 | } |
136 | 136 | |
137 | - if (! $object) { |
|
137 | + if (!$object) { |
|
138 | 138 | $table = Table::getTable($tableName); |
139 | 139 | |
140 | 140 | $object = new \stdClass; |
@@ -75,13 +75,13 @@ |
||
75 | 75 | $query = $request->q; |
76 | 76 | $users = DBM::model($user_model, $user_table)->paginate($perPage); |
77 | 77 | |
78 | - if (! empty($query)) { |
|
78 | + if (!empty($query)) { |
|
79 | 79 | $users = DBM::model($user_model, $user_table) |
80 | 80 | ->where('name', 'LIKE', '%'.$query.'%') |
81 | 81 | ->paginate($perPage); |
82 | 82 | } |
83 | 83 | |
84 | - $users->getCollection()->transform(function ($user) use ($user_display_name) { |
|
84 | + $users->getCollection()->transform(function($user) use ($user_display_name) { |
|
85 | 85 | $user->permissions = DBM::Object() |
86 | 86 | ->setManyToManyRelation( |
87 | 87 | $user, |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | $object = DBM::Object()->where('name', $tableName)->first(); |
50 | 50 | |
51 | - if (is_string($object->model) && ! class_exists($object->model)) { |
|
51 | + if (is_string($object->model) && !class_exists($object->model)) { |
|
52 | 52 | return $this->generateError(['Model not found. Please create model first']); |
53 | 53 | } |
54 | 54 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $value = $this->saveFiles($request, $column, $request->table); |
90 | 90 | } |
91 | 91 | |
92 | - if (! Driver::isMongoDB()) { |
|
92 | + if (!Driver::isMongoDB()) { |
|
93 | 93 | if ($functionName = $this->hasFunction($fields, $column)) { |
94 | 94 | $value = $this->executeFunction($functionName, $value); |
95 | 95 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | $object = DBM::Object()->where('name', $tableName)->first(); |
128 | 128 | |
129 | - if (is_string($object->model) && ! class_exists($object->model)) { |
|
129 | + if (is_string($object->model) && !class_exists($object->model)) { |
|
130 | 130 | return $this->generateError(['Model not found. Please create model first']); |
131 | 131 | } |
132 | 132 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | |
173 | 173 | if ($value !== null && $value !== '') { |
174 | - if (! Driver::isMongoDB()) { |
|
174 | + if (!Driver::isMongoDB()) { |
|
175 | 175 | if ($functionName = $this->hasFunction($fields, $column)) { |
176 | 176 | $value = $this->executeFunction($functionName, $value); |
177 | 177 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $details = $object->details; |
207 | 207 | $key = $details['findColumn']; |
208 | 208 | |
209 | - if (is_string($model) && ! class_exists($model)) { |
|
209 | + if (is_string($model) && !class_exists($model)) { |
|
210 | 210 | return $this->generateError(['Model not found. Please create model first']); |
211 | 211 | } |
212 | 212 | |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $tableName = $request->table; |
247 | 247 | $object = DBM::Object()->where('name', $tableName)->first(); |
248 | 248 | |
249 | - if (! $object) { |
|
249 | + if (!$object) { |
|
250 | 250 | return response()->json([ |
251 | 251 | 'success' => false, |
252 | 252 | 'errors' => ['There is no Object details'], |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | |
266 | 266 | $model = $object->model; |
267 | 267 | |
268 | - if (! class_exists($model)) { |
|
268 | + if (!class_exists($model)) { |
|
269 | 269 | return $this->generateError(['Model not found. Please create model first']); |
270 | 270 | } |
271 | 271 | |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | $searchColumn = $object->details['searchColumn']; |
275 | 275 | $records = DBM::model($model, $tableName)->paginate($perPage); |
276 | 276 | |
277 | - if (! empty($query) && ! empty($searchColumn)) { |
|
277 | + if (!empty($query) && !empty($searchColumn)) { |
|
278 | 278 | $records = DBM::model($model, $tableName) |
279 | 279 | ->where($searchColumn, 'LIKE', '%'.$query.'%') |
280 | 280 | ->paginate($perPage); |
@@ -88,7 +88,7 @@ |
||
88 | 88 | |
89 | 89 | return response()->json([ |
90 | 90 | 'success' => false, |
91 | - 'errors' => ['The template ' + $request->name.' not found'], |
|
91 | + 'errors' => ['The template ' +$request->name.' not found'], |
|
92 | 92 | ], 400); |
93 | 93 | } |
94 | 94 | } |
@@ -65,8 +65,8 @@ |
||
65 | 65 | $files = collect(Storage::allFiles($directory)); |
66 | 66 | |
67 | 67 | $query = $request->q; |
68 | - if (! empty($query)) { |
|
69 | - $files = $files->filter(function ($file) use ($query) { |
|
68 | + if (!empty($query)) { |
|
69 | + $files = $files->filter(function($file) use ($query) { |
|
70 | 70 | $info = pathinfo($file); |
71 | 71 | |
72 | 72 | return false !== stristr($info['basename'], $query); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | return $response; |
40 | 40 | } |
41 | 41 | |
42 | - if (! class_exists($table['controller'])) { |
|
42 | + if (!class_exists($table['controller'])) { |
|
43 | 43 | DBM::makeController($table['controller']); |
44 | 44 | } |
45 | 45 | |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | return $this->generateError(['Model Must be provided']); |
77 | 77 | } |
78 | 78 | |
79 | - if ($table['makeModel'] && ! class_exists($table['model'])) { |
|
79 | + if ($table['makeModel'] && !class_exists($table['model'])) { |
|
80 | 80 | DBM::makeModel($table['model'], $table['name']); |
81 | 81 | } |
82 | 82 | |
83 | - if (! $table['makeModel'] && ! class_exists($table['model'])) { |
|
83 | + if (!$table['makeModel'] && !class_exists($table['model'])) { |
|
84 | 84 | $error = "Create model {$table['model']} first or checked create model option"; |
85 | 85 | |
86 | 86 | return $this->generateError([$error]); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | { |
101 | 101 | $object = DBM::Object()->where('name', $table['name'])->first(); |
102 | 102 | $action = 'update'; |
103 | - if (! $object) { |
|
103 | + if (!$object) { |
|
104 | 104 | $object = DBM::Object(); |
105 | 105 | $object->name = $table['name']; |
106 | 106 | $action = 'save'; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | $action = 'update'; |
144 | 144 | |
145 | - if (! $field) { |
|
145 | + if (!$field) { |
|
146 | 146 | $field = DBM::Field(); |
147 | 147 | $field->dbm_object_id = $object->id; |
148 | 148 | $field->name = $column['name']; |
@@ -87,6 +87,6 @@ |
||
87 | 87 | */ |
88 | 88 | public function confidential() |
89 | 89 | { |
90 | - return ! empty($this->secret); |
|
90 | + return !empty($this->secret); |
|
91 | 91 | } |
92 | 92 | } |
@@ -95,7 +95,7 @@ |
||
95 | 95 | */ |
96 | 96 | public function cant($scope) |
97 | 97 | { |
98 | - return ! $this->can($scope); |
|
98 | + return !$this->can($scope); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -24,7 +24,7 @@ |
||
24 | 24 | $pdo = DB::connection()->getPdo(); |
25 | 25 | |
26 | 26 | // trim the values |
27 | - $fieldDeclaration['allowed'] = array_map(function ($value) use ($pdo) { |
|
27 | + $fieldDeclaration['allowed'] = array_map(function($value) use ($pdo) { |
|
28 | 28 | return $pdo->quote(trim($value)); |
29 | 29 | }, $allowed); |
30 | 30 |