@@ -51,17 +51,17 @@ discard block |
||
51 | 51 | // Get filters |
52 | 52 | $filters = Filter::where('module_id', $module->id) // Module |
53 | 53 | ->where('type', 'list') // Type (list) |
54 | - ->where(function ($query) use($domain) { // Domain |
|
54 | + ->where(function($query) use($domain) { // Domain |
|
55 | 55 | $query->whereNull('domain_id') |
56 | 56 | ->orWhere('domain_id', $domain->getKey()); |
57 | 57 | }) |
58 | - ->where(function ($query) { // User |
|
58 | + ->where(function($query) { // User |
|
59 | 59 | $query->where('is_public', true) |
60 | - ->orWhere(function ($query) { |
|
60 | + ->orWhere(function($query) { |
|
61 | 61 | $query->where('is_public', false) |
62 | 62 | ->where('user_id', '=', auth()->id()); |
63 | 63 | }) |
64 | - ->orWhere(function ($query) { |
|
64 | + ->orWhere(function($query) { |
|
65 | 65 | $query->where('is_public', false) |
66 | 66 | ->whereNull('user_id'); |
67 | 67 | }); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | ->get(); |
71 | 71 | |
72 | 72 | // Order |
73 | - $filterOrder = (array) $selectedFilter->order; |
|
73 | + $filterOrder = (array)$selectedFilter->order; |
|
74 | 74 | |
75 | 75 | // See descendants |
76 | 76 | $seeDescendants = request()->session()->get('descendants'); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | if ($relatedList && $relatedList->method) { |
155 | 155 | // Related list method |
156 | 156 | $method = $relatedList->method; |
157 | - $recordIdsMethod = $method . 'RecordIds'; |
|
157 | + $recordIdsMethod = $method.'RecordIds'; |
|
158 | 158 | |
159 | 159 | // Get related records ids |
160 | 160 | $model = new $modelClass; |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | // Add the record id itself to be filtered |
164 | 164 | if ($relatedList->module_id === $relatedList->related_module_id && !empty($recordId) && !$filteredRecordIds->contains($recordId)) { |
165 | - $filteredRecordIds[] = (int)$recordId; |
|
165 | + $filteredRecordIds[ ] = (int)$recordId; |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | if ($relatedList->module_id) { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $records = $query->paginate($length); |
178 | 178 | } |
179 | 179 | |
180 | - $records->getCollection()->transform(function ($record) use ($domain, $module, $relatedModule) { |
|
180 | + $records->getCollection()->transform(function($record) use ($domain, $module, $relatedModule) { |
|
181 | 181 | foreach ($module->fields as $field) { |
182 | 182 | // If a special template exists, use it. Else use the generic template |
183 | 183 | $uitype = uitype($field->uitype_id); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $results = collect(); |
229 | 229 | if (method_exists($modelClass, 'getSearchResult') && property_exists($modelClass, 'searchableColumns')) { |
230 | 230 | $searchResults = new Search(); |
231 | - $searchResults->registerModel($modelClass, (array) (new $modelClass)->searchableColumns); |
|
231 | + $searchResults->registerModel($modelClass, (array)(new $modelClass)->searchableColumns); |
|
232 | 232 | $results = $searchResults->search($q)->take(config('uccello.max_results.autocomplete', 10)); |
233 | 233 | } |
234 | 234 | |
@@ -249,9 +249,9 @@ discard block |
||
249 | 249 | $savePageLength = $request->input('save_page_length'); |
250 | 250 | |
251 | 251 | // Optional data |
252 | - $data = []; |
|
252 | + $data = [ ]; |
|
253 | 253 | if ($savePageLength) { |
254 | - $data["length"] = $request->input('page_length'); |
|
254 | + $data[ "length" ] = $request->input('page_length'); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | $filter = Filter::firstOrNew([ |
@@ -343,9 +343,9 @@ discard block |
||
343 | 343 | protected function addSearchConditions($filter) |
344 | 344 | { |
345 | 345 | if ($this->request->has('search')) { |
346 | - $conditions = []; |
|
347 | - foreach ((array) $this->request->search as $fieldName => $value) { |
|
348 | - $conditions[$fieldName] = $value; |
|
346 | + $conditions = [ ]; |
|
347 | + foreach ((array)$this->request->search as $fieldName => $value) { |
|
348 | + $conditions[ $fieldName ] = $value; |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | if ($conditions) { |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | |
385 | 385 | if ($rules) { |
386 | 386 | foreach ($rules as $column => $rule) { |
387 | - $filter['columns'][$column]['search'] = $rule; |
|
387 | + $filter[ 'columns' ][ $column ][ 'search' ] = $rule; |
|
388 | 388 | } |
389 | 389 | } |
390 | 390 | } |