@@ -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'); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | if ($relatedList && $relatedList->method) { |
154 | 154 | // Related list method |
155 | 155 | $method = $relatedList->method; |
156 | - $recordIdsMethod = $method . 'RecordIds'; |
|
156 | + $recordIdsMethod = $method.'RecordIds'; |
|
157 | 157 | |
158 | 158 | // Get related records ids |
159 | 159 | $model = new $modelClass; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | // Add the record id itself to be filtered |
163 | 163 | if ($relatedList->module_id === $relatedList->related_module_id && !empty($recordId) && !$filteredRecordIds->contains($recordId)) { |
164 | - $filteredRecordIds[] = (int)$recordId; |
|
164 | + $filteredRecordIds[ ] = (int)$recordId; |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | // Make the quer |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $records = $query->paginate($length); |
173 | 173 | } |
174 | 174 | |
175 | - $records->getCollection()->transform(function ($record) use ($domain, $module) { |
|
175 | + $records->getCollection()->transform(function($record) use ($domain, $module) { |
|
176 | 176 | foreach ($module->fields as $field) { |
177 | 177 | // If a special template exists, use it. Else use the generic template |
178 | 178 | $uitype = uitype($field->uitype_id); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $results = collect(); |
217 | 217 | if (method_exists($modelClass, 'getSearchResult') && property_exists($modelClass, 'searchableColumns')) { |
218 | 218 | $searchResults = new Search(); |
219 | - $searchResults->registerModel($modelClass, (array) (new $modelClass)->searchableColumns); |
|
219 | + $searchResults->registerModel($modelClass, (array)(new $modelClass)->searchableColumns); |
|
220 | 220 | $results = $searchResults->search($q)->take(config('uccello.max_results.autocomplete', 10)); |
221 | 221 | } |
222 | 222 | |
@@ -237,9 +237,9 @@ discard block |
||
237 | 237 | $savePageLength = $request->input('save_page_length'); |
238 | 238 | |
239 | 239 | // Optional data |
240 | - $data = []; |
|
240 | + $data = [ ]; |
|
241 | 241 | if ($savePageLength) { |
242 | - $data["length"] = $request->input('page_length'); |
|
242 | + $data[ "length" ] = $request->input('page_length'); |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | $filter = Filter::firstOrNew([ |
@@ -331,9 +331,9 @@ discard block |
||
331 | 331 | protected function addSearchConditions($filter) |
332 | 332 | { |
333 | 333 | if ($this->request->has('search')) { |
334 | - $conditions = []; |
|
335 | - foreach ((array) $this->request->search as $fieldName => $value) { |
|
336 | - $conditions[$fieldName] = $value; |
|
334 | + $conditions = [ ]; |
|
335 | + foreach ((array)$this->request->search as $fieldName => $value) { |
|
336 | + $conditions[ $fieldName ] = $value; |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | if ($conditions) { |