@@ -109,7 +109,7 @@ |
||
109 | 109 | if (method_exists($modelClass, 'getSearchResult') && property_exists($modelClass, 'searchableColumns')) { |
110 | 110 | // Search related records and get all ids |
111 | 111 | $searchResults = new Search(); |
112 | - $searchResults->registerModel($modelClass, (array) (new $modelClass)->searchableColumns); |
|
112 | + $searchResults->registerModel($modelClass, (array)(new $modelClass)->searchableColumns); |
|
113 | 113 | $recordIds = $searchResults->search($value)->pluck('searchable.id'); |
114 | 114 | |
115 | 115 | // Search records linked to record ids got previously |
@@ -179,7 +179,7 @@ |
||
179 | 179 | */ |
180 | 180 | public function isActiveOnDomain(Domain $domain) : bool |
181 | 181 | { |
182 | - $moduleDomains = Cache::rememberForever('module_'.$this->name.'_domains', function () { |
|
182 | + $moduleDomains = Cache::rememberForever('module_'.$this->name.'_domains', function() { |
|
183 | 183 | return $this->domains; |
184 | 184 | }); |
185 | 185 |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function rolesOnDomain($domain) : Collection |
117 | 117 | { |
118 | - return Cache::remember('domain_'.$domain->slug.'_roles', 600, function () use($domain) { |
|
118 | + return Cache::remember('domain_'.$domain->slug.'_roles', 600, function() use($domain) { |
|
119 | 119 | $roles = collect(); |
120 | 120 | |
121 | 121 | foreach ($this->privileges->where('domain_id', $domain->id) as $privilege) { |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | |
155 | 155 | $hasRole = false; |
156 | 156 | |
157 | - $descendants = Cache::remember('domain_'.$domain->slug.'_descendants', 600, function () use($domain) { |
|
157 | + $descendants = Cache::remember('domain_'.$domain->slug.'_descendants', 600, function() use($domain) { |
|
158 | 158 | return $domain->findDescendants()->get(); |
159 | 159 | }); |
160 | 160 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | { |
181 | 181 | $keyName = 'user_'.$this->id.'_'.$domain->slug.'_'.$module->name.'_capabilities'; |
182 | 182 | |
183 | - return Cache::remember($keyName, 600, function () use($domain, $module) { |
|
183 | + return Cache::remember($keyName, 600, function() use($domain, $module) { |
|
184 | 184 | $capabilities = collect(); |
185 | 185 | |
186 | 186 | // Get the domain and all its parents |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | |
235 | 235 | $keyName = 'user_'.$this->id.'_'.$domain->slug.'_can_access_to_settings_panel'; |
236 | 236 | |
237 | - return Cache::remember($keyName, 600, function () use($domain) { |
|
237 | + return Cache::remember($keyName, 600, function() use($domain) { |
|
238 | 238 | |
239 | 239 | $hasCapability = false; |
240 | 240 |
@@ -187,7 +187,7 @@ |
||
187 | 187 | */ |
188 | 188 | protected function getNotAdminModulesAttribute() : array |
189 | 189 | { |
190 | - return Cache::rememberForever('not_admin_modules', function () { |
|
190 | + return Cache::rememberForever('not_admin_modules', function() { |
|
191 | 191 | $modules = [ ]; |
192 | 192 | |
193 | 193 | foreach ($this->modules()->get() as $module) { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | ->get(); |
52 | 52 | |
53 | 53 | // Order by |
54 | - $filterOrderBy = (array) $selectedFilter->order_by; |
|
54 | + $filterOrderBy = (array)$selectedFilter->order_by; |
|
55 | 55 | |
56 | 56 | return $this->autoView(compact('datatableColumns', 'filters', 'selectedFilter', 'filterOrderBy')); |
57 | 57 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | if ($relatedList && $relatedList->method) { |
116 | 116 | // Related list method |
117 | 117 | $method = $relatedList->method; |
118 | - $recordIdsMethod = $method . 'RecordIds'; |
|
118 | + $recordIdsMethod = $method.'RecordIds'; |
|
119 | 119 | |
120 | 120 | // Get related records ids |
121 | 121 | $model = new $modelClass; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | // Add the record id itself to be filtered |
125 | 125 | if ($relatedList->related_module_id === $module->id && !empty($recordId) && !$filteredRecordIds->contains($recordId)) { |
126 | - $filteredRecordIds[] = (int)$recordId; |
|
126 | + $filteredRecordIds[ ] = (int)$recordId; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | // Make the quer |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $records = $query->paginate($length); |
135 | 135 | } |
136 | 136 | |
137 | - $records->getCollection()->transform(function ($record) use ($domain, $module) { |
|
137 | + $records->getCollection()->transform(function($record) use ($domain, $module) { |
|
138 | 138 | foreach ($module->fields as $field) { |
139 | 139 | // If a special template exists, use it. Else use the generic template |
140 | 140 | $uitype = uitype($field->uitype_id); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $results = collect(); |
175 | 175 | if (method_exists($modelClass, 'getSearchResult') && property_exists($modelClass, 'searchableColumns')) { |
176 | 176 | $searchResults = new Search(); |
177 | - $searchResults->registerModel($modelClass, (array) (new $modelClass)->searchableColumns); |
|
177 | + $searchResults->registerModel($modelClass, (array)(new $modelClass)->searchableColumns); |
|
178 | 178 | $results = $searchResults->search($q)->take(config('uccello.max_results.autocomplete', 10)); |
179 | 179 | } |
180 | 180 | |
@@ -195,9 +195,9 @@ discard block |
||
195 | 195 | $savePageLength = $request->input('save_page_length'); |
196 | 196 | |
197 | 197 | // Optional data |
198 | - $data = []; |
|
198 | + $data = [ ]; |
|
199 | 199 | if ($savePageLength) { |
200 | - $data["length"] = $request->input('page_length'); |
|
200 | + $data[ "length" ] = $request->input('page_length'); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | $filter = Filter::firstOrNew([ |
@@ -52,7 +52,7 @@ |
||
52 | 52 | $modelClass = $module->model_class; |
53 | 53 | |
54 | 54 | if (method_exists($modelClass, 'getSearchResult') && property_exists($modelClass, 'searchableColumns')) { |
55 | - $searchResults->registerModel($modelClass, (array) (new $modelClass)->searchableColumns); |
|
55 | + $searchResults->registerModel($modelClass, (array)(new $modelClass)->searchableColumns); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @param Module $module |
76 | 76 | * @param boolean $forBlade |
77 | 77 | */ |
78 | - protected function preProcess(?Domain &$domain, Module $module, Request $request, $forBlade=true) |
|
78 | + protected function preProcess(?Domain &$domain, Module $module, Request $request, $forBlade = true) |
|
79 | 79 | { |
80 | 80 | // If we don't use multi domains, find the first one |
81 | 81 | if (!uccello()->useMultiDomains()) { |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | { |
158 | 158 | $keyName = $getAdminModules ? 'modules_all' : 'modules_not_admin'; |
159 | 159 | |
160 | - return Cache::rememberForever($keyName, function () use($getAdminModules) { |
|
160 | + return Cache::rememberForever($keyName, function() use($getAdminModules) { |
|
161 | 161 | $modules = [ ]; |
162 | 162 | |
163 | 163 | $allModules = Module::all(); |
@@ -215,11 +215,11 @@ discard block |
||
215 | 215 | */ |
216 | 216 | protected function getDomainsTreeHtml() |
217 | 217 | { |
218 | - return Cache::remember('users', 600, function () { // 10 minutes |
|
218 | + return Cache::remember('users', 600, function() { // 10 minutes |
|
219 | 219 | $domainsTreeHtml = '<ul class="tree tree-level-0">'; |
220 | 220 | |
221 | 221 | $rootDomains = app('uccello')->getRootDomains(); |
222 | - foreach($rootDomains as $root) { |
|
222 | + foreach ($rootDomains as $root) { |
|
223 | 223 | |
224 | 224 | $descendants = $root->findDescendants()->get(); |
225 | 225 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | |
228 | 228 | $html = $tree->render( |
229 | 229 | 'ul', |
230 | - function ($node) { |
|
230 | + function($node) { |
|
231 | 231 | if (auth()->user()->hasRoleOnDomain($node)) { |
232 | 232 | $currentClass = ''; |
233 | 233 | if ($node->id === $this->domain->id) { |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | $value = uitype($field->uitype_id)->getFormattedValueToDisplay($field, $record); |
3 | 3 | $valueParts = explode(';', $value); |
4 | -$fileName = $valueParts[0]; |
|
4 | +$fileName = $valueParts[ 0 ]; |
|
5 | 5 | ?> |
6 | 6 | @if (count($valueParts) === 2) |
7 | 7 | <a href="{{ ucroute('uccello.download', $domain, $module, [ 'id' => $record->getKey(), 'field' => $field->column ]) }}" |
@@ -7,7 +7,7 @@ |
||
7 | 7 | <?php |
8 | 8 | $value = uitype($field->uitype_id)->getFormattedValueToDisplay($field, $record); |
9 | 9 | $valueParts = explode(';', $value); |
10 | - $fileName = $valueParts[0]; |
|
10 | + $fileName = $valueParts[ 0 ]; |
|
11 | 11 | ?> |
12 | 12 | @if (count($valueParts) === 2) |
13 | 13 | <div class="truncate"> |