@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $this->preProcess($domain, $module, $request); |
161 | 161 | |
162 | 162 | // Retrieve record |
163 | - $recordId = (int) request('id'); |
|
163 | + $recordId = (int)request('id'); |
|
164 | 164 | $modelClass = $module->model_class; |
165 | 165 | $record = $modelClass::onlyTrashed()->findOrFail($recordId); |
166 | 166 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | } |
173 | 173 | |
174 | 174 | // Redirect to the trash list |
175 | - $route = ucroute('uccello.list', $domain, $module, ['filter' => 'trash']); |
|
175 | + $route = ucroute('uccello.list', $domain, $module, [ 'filter' => 'trash' ]); |
|
176 | 176 | return redirect($route); |
177 | 177 | } |
178 | 178 | |
@@ -306,15 +306,15 @@ discard block |
||
306 | 306 | |
307 | 307 | // Redirect to source record if a relation was deleted |
308 | 308 | if (isset($relatedlist) && $request->input('id')) { |
309 | - $params = ['id' => $request->input('id')]; |
|
309 | + $params = [ 'id' => $request->input('id') ]; |
|
310 | 310 | |
311 | 311 | // Add tab id if defined to select it automaticaly |
312 | 312 | if ($request->input('tab')) { |
313 | - $params['tab'] = $request->input('tab'); |
|
313 | + $params[ 'tab' ] = $request->input('tab'); |
|
314 | 314 | } |
315 | 315 | // Add related list id to select the related tab automaticaly |
316 | 316 | else { |
317 | - $params['relatedlist'] = $relatedlist->id; |
|
317 | + $params[ 'relatedlist' ] = $relatedlist->id; |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | $route = ucroute('uccello.detail', $domain, $relatedlist->module, $params); |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | } |
29 | 29 | |
30 | 30 | // Create uuid after save |
31 | - static::created(function ($model) { |
|
31 | + static::created(function($model) { |
|
32 | 32 | $module = Module::where('model_class', get_class($model))->first(); |
33 | 33 | if ($module) { |
34 | 34 | Entity::create([ |
35 | - 'id' => (string) Str::uuid(), |
|
35 | + 'id' => (string)Str::uuid(), |
|
36 | 36 | 'module_id' => $module->id, |
37 | 37 | 'record_id' => $model->getKey(), |
38 | 38 | 'creator_id' => auth()->id(), |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | }); |
42 | 42 | |
43 | 43 | // Delete uuid after forced delete |
44 | - static::deleted(function ($model) { |
|
44 | + static::deleted(function($model) { |
|
45 | 45 | if (!empty($model->uuid) && (!method_exists($model, 'isForceDeleting') || $model->isForceDeleting() === true)) { |
46 | 46 | $entity = Entity::find($model->uuid); |
47 | 47 | if ($entity) { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | public function initializeUccelloModule() |
55 | 55 | { |
56 | - $this->appends = array_merge($this->appends, ['recordLabel','uuid']); |
|
56 | + $this->appends = array_merge($this->appends, [ 'recordLabel', 'uuid' ]); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | protected static function isFilteredByUser() |
@@ -85,15 +85,15 @@ discard block |
||
85 | 85 | |
86 | 86 | protected static function getModuleFromClass($className) |
87 | 87 | { |
88 | - $modules = Cache::rememberForever('modules_by_model_class', function () { |
|
88 | + $modules = Cache::rememberForever('modules_by_model_class', function() { |
|
89 | 89 | $modulesGroupedByModelClass = collect(); |
90 | - Module::all()->map(function ($item) use ($modulesGroupedByModelClass) { |
|
91 | - $modulesGroupedByModelClass[$item->model_class] = $item; |
|
90 | + Module::all()->map(function($item) use ($modulesGroupedByModelClass) { |
|
91 | + $modulesGroupedByModelClass[ $item->model_class ] = $item; |
|
92 | 92 | return $modulesGroupedByModelClass; |
93 | 93 | }); |
94 | 94 | return $modulesGroupedByModelClass; |
95 | 95 | }); |
96 | - return $modules[(string) $className] ?? null; |
|
96 | + return $modules[ (string)$className ] ?? null; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | public function getUuidAttribute() |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | parent::boot(); |
68 | 68 | |
69 | 69 | // Linck to parent record |
70 | - static::created(function ($model) { |
|
70 | + static::created(function($model) { |
|
71 | 71 | static::linkToParentRecord($model); |
72 | 72 | }); |
73 | 73 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | // static::linkToParentRecord($model); |
76 | 76 | // }); |
77 | 77 | |
78 | - static::updated(function ($model) { |
|
78 | + static::updated(function($model) { |
|
79 | 79 | static::linkToParentRecord($model); |
80 | 80 | }); |
81 | 81 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | public function isRoot() |
104 | 104 | { |
105 | 105 | // return (empty($this->{$this->getTreeColumn('parent')})) ? true : false; |
106 | - return $this->{$this->getTreeColumn('path')} === $this->getKey() . '/' |
|
106 | + return $this->{$this->getTreeColumn('path')} === $this->getKey().'/' |
|
107 | 107 | && $this->{$this->getTreeColumn('level')} === 0; |
108 | 108 | } |
109 | 109 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | protected function getNotAdminModulesAttribute() : array |
235 | 235 | { |
236 | - return Cache::rememberForever('not_admin_modules', function () { |
|
236 | + return Cache::rememberForever('not_admin_modules', function() { |
|
237 | 237 | $modules = [ ]; |
238 | 238 | |
239 | 239 | foreach ($this->modules()->get() as $module) { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | parent::boot(); |
53 | 53 | |
54 | 54 | // Linck to parent record |
55 | - static::created(function ($model) { |
|
55 | + static::created(function($model) { |
|
56 | 56 | static::linkToParentRecord($model); |
57 | 57 | }); |
58 | 58 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | // static::linkToParentRecord($model); |
61 | 61 | // }); |
62 | 62 | |
63 | - static::updated(function ($model) { |
|
63 | + static::updated(function($model) { |
|
64 | 64 | static::linkToParentRecord($model); |
65 | 65 | }); |
66 | 66 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | public function isRoot() |
88 | 88 | { |
89 | 89 | // return (empty($this->{$this->getTreeColumn('parent')})) ? true : false; |
90 | - return $this->{$this->getTreeColumn('path')} === $this->getKey() . '/' |
|
90 | + return $this->{$this->getTreeColumn('path')} === $this->getKey().'/' |
|
91 | 91 | && $this->{$this->getTreeColumn('level')} === 0; |
92 | 92 | } |
93 | 93 |
@@ -25,11 +25,11 @@ |
||
25 | 25 | 'creator_id', |
26 | 26 | ]; |
27 | 27 | |
28 | - protected $primaryKey = 'id'; // TODO: Change to "uid" to make joins withs modules tables possible ??? |
|
28 | + protected $primaryKey = 'id'; // TODO: Change to "uid" to make joins withs modules tables possible ??? |
|
29 | 29 | public $incrementing = false; |
30 | 30 | |
31 | 31 | // Allow Eloquent to return id as string instead of int. |
32 | - protected $casts = ['id' => 'string']; |
|
32 | + protected $casts = [ 'id' => 'string' ]; |
|
33 | 33 | |
34 | 34 | protected function initTablePrefix() |
35 | 35 | { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | public function getFormattedValueToDisplay(Field $field, $record) : string |
76 | 76 | { |
77 | 77 | if (isset($field->data->multiple) && $field->data->multiple === true && !empty($record->{$field->column})) { |
78 | - $values = []; |
|
78 | + $values = [ ]; |
|
79 | 79 | |
80 | 80 | $fieldValues = json_decode($record->{$field->column}); |
81 | 81 | if (is_array($fieldValues)) { |
@@ -84,13 +84,13 @@ discard block |
||
84 | 84 | continue; |
85 | 85 | } |
86 | 86 | |
87 | - $values[] = uctrans($value, $field->module); |
|
87 | + $values[ ] = uctrans($value, $field->module); |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
91 | 91 | $value = implode(', ', $values); |
92 | 92 | } else { |
93 | - $value = parent::getFormattedValueToDisplay($field, $record); |
|
93 | + $value = parent::getFormattedValueToDisplay($field, $record); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | return $value; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | $roots = collect(); |
61 | 61 | foreach ($rootRecords as $record) { |
62 | - $roots[] = $this->getFormattedRecordToAdd($record); |
|
62 | + $roots[ ] = $this->getFormattedRecordToAdd($record); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | return $roots; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $children = collect(); |
86 | 86 | if ($parentRecord) { |
87 | 87 | foreach ($parentRecord->children()->get() as $record) { |
88 | - $children[] = $this->getFormattedRecordToAdd($record); |
|
88 | + $children[ ] = $this->getFormattedRecordToAdd($record); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | @if ($value) |
17 | 17 | <?php |
18 | 18 | $valueParts = explode(';', $value); |
19 | - $fileName = $valueParts[0]; |
|
19 | + $fileName = $valueParts[ 0 ]; |
|
20 | 20 | ?> |
21 | 21 | <div class="input-field current-file"> |
22 | 22 | <div class="file-container"> |
@@ -44,7 +44,7 @@ |
||
44 | 44 | foreach ($treeDomainsIds as $treeDomainId) { |
45 | 45 | $_domain = Domain::find($treeDomainId); |
46 | 46 | foreach ($_domain->roles as $role) { |
47 | - $roleName = $_domain->id === $domain->id ? $role->name : $_domain->name . ' > ' . $role->name; |
|
47 | + $roleName = $_domain->id === $domain->id ? $role->name : $_domain->name.' > '.$role->name; |
|
48 | 48 | $roles[ $role->id ] = $roleName; |
49 | 49 | } |
50 | 50 | } |