@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | parent::boot(); |
21 | 21 | |
22 | 22 | // Bind domain |
23 | - Route::bind('domain', function ($value) { |
|
23 | + Route::bind('domain', function($value) { |
|
24 | 24 | if (preg_match('`^[0-9]+$`', $value)) { // By id |
25 | 25 | $domain = Domain::findOrFail($value); |
26 | 26 | } else { // By slug |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | }); |
31 | 31 | |
32 | 32 | // Bind module |
33 | - Route::bind('module', function ($value) { |
|
33 | + Route::bind('module', function($value) { |
|
34 | 34 | if (preg_match('`^[0-9]+$`', $value)) { // By id |
35 | 35 | $module = Module::findOrFail($value); |
36 | 36 | } else { // By name |
@@ -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) { |
@@ -234,8 +234,7 @@ |
||
234 | 234 | // $currentClass = 'class="green-text"'; |
235 | 235 | // } |
236 | 236 | return '<li><a href="'.ucroute('uccello.home', $node).'" '.$currentClass.'>'.$node->name.'</a>{sub-tree}</li>'; |
237 | - } |
|
238 | - elseif (auth()->user()->hasRoleOnDescendantDomain($node)) { |
|
237 | + } elseif (auth()->user()->hasRoleOnDescendantDomain($node)) { |
|
239 | 238 | return '<li>'.$node->name.'{sub-tree}</li>'; |
240 | 239 | } else { |
241 | 240 | return ''; |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | protected function getSettingsModule() |
29 | 29 | { |
30 | - return Module::where('name', 'settings')->first(); |
|
30 | + return Module::where('name', 'settings')->first(); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | public function testModuleActivationCanBeChanged() |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | }); |
53 | 53 | |
54 | 54 | $validator = Validator::make(request()->all(), [ |
55 | - 'username' => $rules['username'], |
|
56 | - 'name' => $rules['name'], |
|
57 | - 'email' => $rules['email'], |
|
55 | + 'username' => $rules[ 'username' ], |
|
56 | + 'name' => $rules[ 'name' ], |
|
57 | + 'email' => $rules[ 'email' ], |
|
58 | 58 | ]); |
59 | 59 | |
60 | 60 | if ($validator->fails()) { |
@@ -93,11 +93,11 @@ discard block |
||
93 | 93 | if (request('avatar')) { |
94 | 94 | $image = str_replace('data:image/png;base64,', '', request('avatar')); |
95 | 95 | $image = str_replace(' ', '+', $image); |
96 | - $imageName = 'user-' . $user->id . '.png'; |
|
96 | + $imageName = 'user-'.$user->id.'.png'; |
|
97 | 97 | $path = storage_path('app/public/avatar/'); |
98 | - $filepath = $path . $imageName; |
|
98 | + $filepath = $path.$imageName; |
|
99 | 99 | |
100 | - if(!\File::isDirectory($path)){ |
|
100 | + if (!\File::isDirectory($path)) { |
|
101 | 101 | \File::makeDirectory($path, 0777, true, true); |
102 | 102 | } |
103 | 103 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | $field = Field::where('module_id', ucmodule('user')->id)->where('name', 'password')->first(); |
130 | 130 | $password_rules = isset($field->data->rules) ? explode('|', $field->data->rules) : ''; |
131 | - $password_rules[] = 'confirmed'; |
|
131 | + $password_rules[ ] = 'confirmed'; |
|
132 | 132 | |
133 | 133 | $validator = Validator::make(request()->all(), [ |
134 | 134 | 'current_password' => function($attribute, $value, $fail) use ($user) { |
@@ -20,19 +20,19 @@ |
||
20 | 20 | public function run() |
21 | 21 | { |
22 | 22 | // Get module |
23 | - $module = ucmodule($this->config['module']); |
|
23 | + $module = ucmodule($this->config[ 'module' ]); |
|
24 | 24 | |
25 | 25 | // Get record |
26 | 26 | $modelClass = $module->model_class; |
27 | - $record = $modelClass::find($this->config['record_id']); |
|
27 | + $record = $modelClass::find($this->config[ 'record_id' ]); |
|
28 | 28 | |
29 | 29 | return view('uccello::widgets.relatedlist', [ |
30 | 30 | 'config' => $this->config, |
31 | - 'domain' => ucdomain($this->config['domain']), |
|
31 | + 'domain' => ucdomain($this->config[ 'domain' ]), |
|
32 | 32 | 'module' => $module, |
33 | - 'data' => (object) $this->config['data'], |
|
33 | + 'data' => (object)$this->config[ 'data' ], |
|
34 | 34 | 'record' => $record, |
35 | - 'label' => $this->config['data']->label ?? $this->config['labelForTranslation'], |
|
35 | + 'label' => $this->config[ 'data' ]->label ?? $this->config[ 'labelForTranslation' ], |
|
36 | 36 | ]); |
37 | 37 | } |
38 | 38 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | ]); |
47 | 47 | |
48 | 48 | Entity::create([ |
49 | - 'id' => (string) Str::uuid(), |
|
49 | + 'id' => (string)Str::uuid(), |
|
50 | 50 | 'module_id' => ucmodule('domain')->id, |
51 | 51 | 'record_id' => $domain->getKey(), |
52 | 52 | ]); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | ]); |
62 | 62 | |
63 | 63 | Entity::create([ |
64 | - 'id' => (string) Str::uuid(), |
|
64 | + 'id' => (string)Str::uuid(), |
|
65 | 65 | 'module_id' => ucmodule('profile')->id, |
66 | 66 | 'record_id' => $profile->getKey(), |
67 | 67 | ]); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $role->profiles()->attach($profile); |
92 | 92 | |
93 | 93 | Entity::create([ |
94 | - 'id' => (string) Str::uuid(), |
|
94 | + 'id' => (string)Str::uuid(), |
|
95 | 95 | 'module_id' => ucmodule('role')->id, |
96 | 96 | 'record_id' => $role->getKey(), |
97 | 97 | ]); |
@@ -33,7 +33,7 @@ |
||
33 | 33 | 'uitype_id' => uitype('boolean')->id, |
34 | 34 | 'displaytype_id' => displaytype('everywhere')->id, |
35 | 35 | 'sequence' => 3, |
36 | - 'data' => [ 'info' => 'field_info.see_descendants_records'] |
|
36 | + 'data' => [ 'info' => 'field_info.see_descendants_records' ] |
|
37 | 37 | ]); |
38 | 38 | |
39 | 39 | $filter = Filter::where('module_id', $roleModule->id)->where('name', 'filter.all')->first(); |
@@ -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 | } |
@@ -154,7 +154,7 @@ |
||
154 | 154 | |
155 | 155 | // Add tab id if defined |
156 | 156 | if ($this->tab_id) { |
157 | - $params['tab'] = $this->tab_id; |
|
157 | + $params[ 'tab' ] = $this->tab_id; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | return ucroute('uccello.edit.relation.delete', $domain, $this->relatedModule, $params); |