@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | break; |
68 | 68 | } |
69 | 69 | |
70 | - if (! $mimeType) { |
|
70 | + if (!$mimeType) { |
|
71 | 71 | $mimeType = 'text/plain'; |
72 | 72 | } |
73 | 73 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | $path = app_path().DIRECTORY_SEPARATOR.$directory; |
131 | 131 | |
132 | - if (! File::isDirectory($path)) { |
|
132 | + if (!File::isDirectory($path)) { |
|
133 | 133 | File::makeDirectory($path, 0777, true, true); |
134 | 134 | } |
135 | 135 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | 'password' => $request->data['password'], |
38 | 38 | ]; |
39 | 39 | |
40 | - if (! Auth::attempt($credentials)) { |
|
40 | + if (!Auth::attempt($credentials)) { |
|
41 | 41 | return $this->generateError(["Email and password combination doesn't match"]); |
42 | 42 | } |
43 | 43 |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | if ($collection) { |
103 | 103 | $id = $collection->_id; |
104 | - $fieldNames = (! empty($collection->fields)) ? $collection->fields->pluck('old_name')->toArray() : []; |
|
104 | + $fieldNames = (!empty($collection->fields)) ? $collection->fields->pluck('old_name')->toArray() : []; |
|
105 | 105 | |
106 | 106 | foreach ($columns as $column) { |
107 | 107 | if (in_array($column['oldName'], $fieldNames)) { |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | |
254 | 254 | $table = $request->table; |
255 | 255 | |
256 | - if (! is_array($table)) { |
|
256 | + if (!is_array($table)) { |
|
257 | 257 | $table = json_decode($table, true); |
258 | 258 | } |
259 | 259 |
@@ -112,13 +112,13 @@ |
||
112 | 112 | $localModel = $relationship['localModel']; |
113 | 113 | $foreignModel = $relationship['foreignModel']; |
114 | 114 | |
115 | - if (! class_exists($localModel)) { |
|
115 | + if (!class_exists($localModel)) { |
|
116 | 116 | $error = "{$localModel} Model not found. Please create the {$localModel} model first"; |
117 | 117 | |
118 | 118 | return $this->generateError([$error]); |
119 | 119 | } |
120 | 120 | |
121 | - if (! class_exists($foreignModel)) { |
|
121 | + if (!class_exists($foreignModel)) { |
|
122 | 122 | $error = "{$foreignModel} Model not found. Please create the {$foreignModel} model first"; |
123 | 123 | |
124 | 124 | return $this->generateError([$error]); |
@@ -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); |