@@ -123,7 +123,7 @@ |
||
| 123 | 123 | protected function isEmptyOrNotEmptySearchQuery(Builder &$query, Field $field, $value): bool |
| 124 | 124 | { |
| 125 | 125 | if ($value === uctrans('filter.search_flag.empty', $field->module)) { |
| 126 | - $query->where(function ($q) use ($field) { |
|
| 126 | + $query->where(function($q) use ($field) { |
|
| 127 | 127 | $q->whereNull($field->column) |
| 128 | 128 | ->orWhere($field->column, '=', ''); |
| 129 | 129 | }); |
@@ -234,26 +234,26 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | if (is_numeric($nameOrId)) { |
| 236 | 236 | // Use cache |
| 237 | - $modules = Cache::rememberForever('modules_by_id', function () { |
|
| 237 | + $modules = Cache::rememberForever('modules_by_id', function() { |
|
| 238 | 238 | $modulesGroupedById = collect(); |
| 239 | 239 | Module::all()->map(function($item) use($modulesGroupedById) { |
| 240 | - $modulesGroupedById[$item->id] = $item; |
|
| 240 | + $modulesGroupedById[ $item->id ] = $item; |
|
| 241 | 241 | return $modulesGroupedById; |
| 242 | 242 | }); |
| 243 | 243 | return $modulesGroupedById; |
| 244 | 244 | }); |
| 245 | - return $modules[(string) $nameOrId] ?? null; |
|
| 245 | + return $modules[ (string)$nameOrId ] ?? null; |
|
| 246 | 246 | } else { |
| 247 | 247 | // Use cache |
| 248 | - $modules = Cache::rememberForever('modules_by_name', function () { |
|
| 248 | + $modules = Cache::rememberForever('modules_by_name', function() { |
|
| 249 | 249 | $modulesGroupedByName = collect(); |
| 250 | 250 | Module::all()->map(function($item) use($modulesGroupedByName) { |
| 251 | - $modulesGroupedByName[$item->name] = $item; |
|
| 251 | + $modulesGroupedByName[ $item->name ] = $item; |
|
| 252 | 252 | return $modulesGroupedByName; |
| 253 | 253 | }); |
| 254 | 254 | return $modulesGroupedByName; |
| 255 | 255 | }); |
| 256 | - return $modules[(string) $nameOrId] ?? null; |
|
| 256 | + return $modules[ (string)$nameOrId ] ?? null; |
|
| 257 | 257 | } |
| 258 | 258 | } |
| 259 | 259 | |
@@ -271,26 +271,26 @@ discard block |
||
| 271 | 271 | |
| 272 | 272 | if (is_numeric($nameOrId)) { |
| 273 | 273 | // Use cache |
| 274 | - $uitypes = Cache::rememberForever('uitypes_by_id', function () { |
|
| 274 | + $uitypes = Cache::rememberForever('uitypes_by_id', function() { |
|
| 275 | 275 | $uitypesGroupedById = collect(); |
| 276 | 276 | Uitype::all()->map(function($item) use($uitypesGroupedById) { |
| 277 | - $uitypesGroupedById[$item->id] = $item; |
|
| 277 | + $uitypesGroupedById[ $item->id ] = $item; |
|
| 278 | 278 | return $uitypesGroupedById; |
| 279 | 279 | }); |
| 280 | 280 | return $uitypesGroupedById; |
| 281 | 281 | }); |
| 282 | - return $uitypes[(string) $nameOrId] ?? null; |
|
| 282 | + return $uitypes[ (string)$nameOrId ] ?? null; |
|
| 283 | 283 | } else { |
| 284 | 284 | // Use cache |
| 285 | - $uitypes = Cache::rememberForever('uitypes_by_name', function () { |
|
| 285 | + $uitypes = Cache::rememberForever('uitypes_by_name', function() { |
|
| 286 | 286 | $uitypesGroupedByName = collect(); |
| 287 | 287 | Uitype::all()->map(function($item) use($uitypesGroupedByName) { |
| 288 | - $uitypesGroupedByName[$item->name] = $item; |
|
| 288 | + $uitypesGroupedByName[ $item->name ] = $item; |
|
| 289 | 289 | return $uitypesGroupedByName; |
| 290 | 290 | }); |
| 291 | 291 | return $uitypesGroupedByName; |
| 292 | 292 | }); |
| 293 | - return $uitypes[(string) $nameOrId] ?? null; |
|
| 293 | + return $uitypes[ (string)$nameOrId ] ?? null; |
|
| 294 | 294 | } |
| 295 | 295 | } |
| 296 | 296 | |
@@ -308,26 +308,26 @@ discard block |
||
| 308 | 308 | |
| 309 | 309 | if (is_numeric($nameOrId)) { |
| 310 | 310 | // Use cache |
| 311 | - $displaytypes = Cache::rememberForever('displaytypes_by_id', function () { |
|
| 311 | + $displaytypes = Cache::rememberForever('displaytypes_by_id', function() { |
|
| 312 | 312 | $displaytypesGroupedById = collect(); |
| 313 | 313 | Displaytype::all()->map(function($item) use($displaytypesGroupedById) { |
| 314 | - $displaytypesGroupedById[$item->id] = $item; |
|
| 314 | + $displaytypesGroupedById[ $item->id ] = $item; |
|
| 315 | 315 | return $displaytypesGroupedById; |
| 316 | 316 | }); |
| 317 | 317 | return $displaytypesGroupedById; |
| 318 | 318 | }); |
| 319 | - return $displaytypes[(string) $nameOrId] ?? null; |
|
| 319 | + return $displaytypes[ (string)$nameOrId ] ?? null; |
|
| 320 | 320 | } else { |
| 321 | 321 | // Use cache |
| 322 | - $displaytypes = Cache::rememberForever('displaytypes_by_name', function () { |
|
| 322 | + $displaytypes = Cache::rememberForever('displaytypes_by_name', function() { |
|
| 323 | 323 | $displaytypesGroupedByName = collect(); |
| 324 | 324 | Displaytype::all()->map(function($item) use($displaytypesGroupedByName) { |
| 325 | - $displaytypesGroupedByName[$item->name] = $item; |
|
| 325 | + $displaytypesGroupedByName[ $item->name ] = $item; |
|
| 326 | 326 | return $displaytypesGroupedByName; |
| 327 | 327 | }); |
| 328 | 328 | return $displaytypesGroupedByName; |
| 329 | 329 | }); |
| 330 | - return $displaytypes[(string) $nameOrId] ?? null; |
|
| 330 | + return $displaytypes[ (string)$nameOrId ] ?? null; |
|
| 331 | 331 | } |
| 332 | 332 | } |
| 333 | 333 | |
@@ -345,26 +345,26 @@ discard block |
||
| 345 | 345 | |
| 346 | 346 | if (is_numeric($nameOrId)) { |
| 347 | 347 | // Use cache |
| 348 | - $capabilities = Cache::rememberForever('capabilities_by_id', function () { |
|
| 348 | + $capabilities = Cache::rememberForever('capabilities_by_id', function() { |
|
| 349 | 349 | $capabilitiesGroupedById = collect(); |
| 350 | 350 | Capability::all()->map(function($item) use($capabilitiesGroupedById) { |
| 351 | - $capabilitiesGroupedById[$item->id] = $item; |
|
| 351 | + $capabilitiesGroupedById[ $item->id ] = $item; |
|
| 352 | 352 | return $capabilitiesGroupedById; |
| 353 | 353 | }); |
| 354 | 354 | return $capabilitiesGroupedById; |
| 355 | 355 | }); |
| 356 | - return $capabilities[(string) $nameOrId] ?? null; |
|
| 356 | + return $capabilities[ (string)$nameOrId ] ?? null; |
|
| 357 | 357 | } else { |
| 358 | 358 | // Use cache |
| 359 | - $capabilities = Cache::rememberForever('capabilities_by_name', function () { |
|
| 359 | + $capabilities = Cache::rememberForever('capabilities_by_name', function() { |
|
| 360 | 360 | $capabilitiesGroupedByName = collect(); |
| 361 | 361 | Capability::all()->map(function($item) use($capabilitiesGroupedByName) { |
| 362 | - $capabilitiesGroupedByName[$item->name] = $item; |
|
| 362 | + $capabilitiesGroupedByName[ $item->name ] = $item; |
|
| 363 | 363 | return $capabilitiesGroupedByName; |
| 364 | 364 | }); |
| 365 | 365 | return $capabilitiesGroupedByName; |
| 366 | 366 | }); |
| 367 | - return $capabilities[(string) $nameOrId] ?? null; |
|
| 367 | + return $capabilities[ (string)$nameOrId ] ?? null; |
|
| 368 | 368 | } |
| 369 | 369 | } |
| 370 | 370 | |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | * @param string $type |
| 407 | 407 | * @return array |
| 408 | 408 | */ |
| 409 | - public function getDatatableColumns(Module $module, $filterId=null, $type='list'): array |
|
| 409 | + public function getDatatableColumns(Module $module, $filterId = null, $type = 'list'): array |
|
| 410 | 410 | { |
| 411 | 411 | $columns = [ ]; |
| 412 | 412 | |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | $field = $module->fields->where('name', $fieldName)->first(); |
| 440 | 440 | |
| 441 | 441 | // If the field does not exist or is not listable, continue |
| 442 | - if (!$field || !$field->isListable() || in_array($fieldName, $fieldsAdded)) { |
|
| 442 | + if (!$field || !$field->isListable() || in_array($fieldName, $fieldsAdded)) { |
|
| 443 | 443 | continue; |
| 444 | 444 | } |
| 445 | 445 | |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | * @param string $type |
| 491 | 491 | * @return Filter |
| 492 | 492 | */ |
| 493 | - public function getDefaultFilter(Module $module, $type="list") |
|
| 493 | + public function getDefaultFilter(Module $module, $type = "list") |
|
| 494 | 494 | { |
| 495 | 495 | $filter = Filter::where('module_id', $module->id) |
| 496 | 496 | ->where('type', $type) |
@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | }); |
| 54 | 54 | |
| 55 | 55 | $validator = Validator::make(request()->all(), [ |
| 56 | - 'username' => $rules['username'], |
|
| 57 | - 'name' => $rules['name'], |
|
| 58 | - 'email' => $rules['email'], |
|
| 56 | + 'username' => $rules[ 'username' ], |
|
| 57 | + 'name' => $rules[ 'name' ], |
|
| 58 | + 'email' => $rules[ 'email' ], |
|
| 59 | 59 | ]); |
| 60 | 60 | |
| 61 | 61 | if ($validator->fails()) { |
@@ -94,11 +94,11 @@ discard block |
||
| 94 | 94 | if (request('avatar')) { |
| 95 | 95 | $image = str_replace('data:image/png;base64,', '', request('avatar')); |
| 96 | 96 | $image = str_replace(' ', '+', $image); |
| 97 | - $imageName = 'user-' . $user->id . '.png'; |
|
| 97 | + $imageName = 'user-'.$user->id.'.png'; |
|
| 98 | 98 | $path = storage_path('app/public/avatar/'); |
| 99 | - $filepath = $path . $imageName; |
|
| 99 | + $filepath = $path.$imageName; |
|
| 100 | 100 | |
| 101 | - if(!\File::isDirectory($path)){ |
|
| 101 | + if (!\File::isDirectory($path)) { |
|
| 102 | 102 | \File::makeDirectory($path, 0777, true, true); |
| 103 | 103 | } |
| 104 | 104 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | $field = Field::where('module_id', ucmodule('user')->id)->where('name', 'password')->first(); |
| 131 | 131 | $password_rules = isset($field->data->rules) ? explode('|', $field->data->rules) : ''; |
| 132 | - $password_rules[] = 'confirmed'; |
|
| 132 | + $password_rules[ ] = 'confirmed'; |
|
| 133 | 133 | |
| 134 | 134 | $validator = Validator::make(request()->all(), [ |
| 135 | 135 | 'current_password' => function($attribute, $value, $fail) use ($user) { |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | $data = $userSettings->data ?? new \stdClass; |
| 174 | 174 | |
| 175 | - foreach ((array) request('settings') as $key => $value) { |
|
| 175 | + foreach ((array)request('settings') as $key => $value) { |
|
| 176 | 176 | if ($value === 'true') { |
| 177 | 177 | $value = true; |
| 178 | 178 | } elseif ($value === 'false') { |
@@ -19,14 +19,14 @@ discard block |
||
| 19 | 19 | $domain = Domain::firstOrFail(); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - return Cache::rememberForever('domains_root_user_'.auth()->id(), function () use($domain) { |
|
| 22 | + return Cache::rememberForever('domains_root_user_'.auth()->id(), function() use($domain) { |
|
| 23 | 23 | $rootDomains = app('uccello')->getRootDomains(); |
| 24 | 24 | |
| 25 | - $domains = []; |
|
| 25 | + $domains = [ ]; |
|
| 26 | 26 | foreach ($rootDomains as $_domain) { |
| 27 | 27 | $formattedDomain = $this->getFormattedDomainToAdd($domain, $_domain); |
| 28 | 28 | if ($formattedDomain) { |
| 29 | - $domains[] = $formattedDomain; |
|
| 29 | + $domains[ ] = $formattedDomain; |
|
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | |
@@ -48,13 +48,13 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | $parentDomain = Domain::find(request('id')); |
| 50 | 50 | |
| 51 | - return Cache::rememberForever('domains_'.$parentDomain->id.'_children_user_'.auth()->id(), function () use($domain, $parentDomain) { |
|
| 52 | - $domains = []; |
|
| 51 | + return Cache::rememberForever('domains_'.$parentDomain->id.'_children_user_'.auth()->id(), function() use($domain, $parentDomain) { |
|
| 52 | + $domains = [ ]; |
|
| 53 | 53 | if ($parentDomain) { |
| 54 | 54 | foreach ($parentDomain->children()->orderBy('name')->get() as $_domain) { |
| 55 | 55 | $formattedDomain = $this->getFormattedDomainToAdd($domain, $_domain); |
| 56 | 56 | if ($formattedDomain) { |
| 57 | - $domains[] = $formattedDomain; |
|
| 57 | + $domains[ ] = $formattedDomain; |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -44,9 +44,9 @@ discard block |
||
| 44 | 44 | public function down() |
| 45 | 45 | { |
| 46 | 46 | // Drop table |
| 47 | - Schema::dropIfExists($this->tablePrefix . 'groups'); |
|
| 48 | - Schema::dropIfExists($this->tablePrefix . 'rl_groups_groups'); |
|
| 49 | - Schema::dropIfExists($this->tablePrefix . 'rl_groups_users'); |
|
| 47 | + Schema::dropIfExists($this->tablePrefix.'groups'); |
|
| 48 | + Schema::dropIfExists($this->tablePrefix.'rl_groups_groups'); |
|
| 49 | + Schema::dropIfExists($this->tablePrefix.'rl_groups_users'); |
|
| 50 | 50 | |
| 51 | 51 | // Delete module |
| 52 | 52 | Module::where('name', 'group')->forceDelete(); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | protected function createTables() |
| 56 | 56 | { |
| 57 | 57 | // Module Table |
| 58 | - Schema::create($this->tablePrefix . 'groups', function (Blueprint $table) { |
|
| 58 | + Schema::create($this->tablePrefix.'groups', function(Blueprint $table) { |
|
| 59 | 59 | $table->increments('id'); |
| 60 | 60 | $table->string('name')->nullable(); |
| 61 | 61 | $table->text('description')->nullable(); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | }); |
| 65 | 65 | |
| 66 | 66 | // Related List Table: Groups-Groups |
| 67 | - Schema::create($this->tablePrefix . 'rl_groups_groups', function (Blueprint $table) { |
|
| 67 | + Schema::create($this->tablePrefix.'rl_groups_groups', function(Blueprint $table) { |
|
| 68 | 68 | $table->increments('id'); |
| 69 | 69 | $table->unsignedInteger('parent_id'); |
| 70 | 70 | $table->unsignedInteger('children_id'); |
@@ -72,19 +72,19 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | // Foreign keys |
| 74 | 74 | $table->foreign('parent_id') |
| 75 | - ->references('id')->on($this->tablePrefix . 'groups') |
|
| 75 | + ->references('id')->on($this->tablePrefix.'groups') |
|
| 76 | 76 | ->onDelete('cascade'); |
| 77 | 77 | |
| 78 | 78 | $table->foreign('children_id') |
| 79 | - ->references('id')->on($this->tablePrefix . 'groups') |
|
| 79 | + ->references('id')->on($this->tablePrefix.'groups') |
|
| 80 | 80 | ->onDelete('cascade'); |
| 81 | 81 | |
| 82 | 82 | // Unique keys |
| 83 | - $table->unique(['parent_id', 'children_id']); |
|
| 83 | + $table->unique([ 'parent_id', 'children_id' ]); |
|
| 84 | 84 | }); |
| 85 | 85 | |
| 86 | 86 | // Related List Table: Groups-Users |
| 87 | - Schema::create($this->tablePrefix . 'rl_groups_users', function (Blueprint $table) { |
|
| 87 | + Schema::create($this->tablePrefix.'rl_groups_users', function(Blueprint $table) { |
|
| 88 | 88 | $table->increments('id'); |
| 89 | 89 | $table->unsignedInteger('group_id'); |
| 90 | 90 | $table->unsignedInteger('user_id'); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | // Foreign keys |
| 94 | 94 | $table->foreign('group_id') |
| 95 | - ->references('id')->on($this->tablePrefix . 'groups') |
|
| 95 | + ->references('id')->on($this->tablePrefix.'groups') |
|
| 96 | 96 | ->onDelete('cascade'); |
| 97 | 97 | |
| 98 | 98 | $table->foreign('user_id') |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | ->onDelete('cascade'); |
| 101 | 101 | |
| 102 | 102 | // Unique keys |
| 103 | - $table->unique(['group_id', 'user_id']); |
|
| 103 | + $table->unique([ 'group_id', 'user_id' ]); |
|
| 104 | 104 | }); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $filter->user_id = null; |
| 167 | 167 | $filter->name = 'filter.all'; |
| 168 | 168 | $filter->type = 'list'; |
| 169 | - $filter->columns = [ 'name', 'description']; |
|
| 169 | + $filter->columns = [ 'name', 'description' ]; |
|
| 170 | 170 | $filter->conditions = null; |
| 171 | 171 | $filter->order_by = null; |
| 172 | 172 | $filter->is_default = true; |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | 'method' => 'getRelatedList', |
| 199 | 199 | 'data' => [ |
| 200 | 200 | "relationName" => "childrenGroups", |
| 201 | - "actions" => ["select", "add"] |
|
| 201 | + "actions" => [ "select", "add" ] |
|
| 202 | 202 | ], |
| 203 | 203 | 'sequence' => 0 |
| 204 | 204 | ]); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | 'label' => 'relatedlist.users', |
| 216 | 216 | 'type' => 'n-n', |
| 217 | 217 | 'method' => 'getRelatedList', |
| 218 | - 'data' => ["actions" => ["select", "add"]], |
|
| 218 | + 'data' => [ "actions" => [ "select", "add" ] ], |
|
| 219 | 219 | 'sequence' => 1 |
| 220 | 220 | ]); |
| 221 | 221 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | public function up() |
| 18 | 18 | { |
| 19 | - Schema::create($this->tablePrefix . 'user_settings', function (Blueprint $table) { |
|
| 19 | + Schema::create($this->tablePrefix.'user_settings', function(Blueprint $table) { |
|
| 20 | 20 | $table->unsignedInteger('user_id')->primary(); |
| 21 | 21 | $table->longText('data'); |
| 22 | 22 | $table->timestamps(); |
@@ -32,6 +32,6 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function down() |
| 34 | 34 | { |
| 35 | - Schema::dropIfExists($this->tablePrefix . 'user_settings'); |
|
| 35 | + Schema::dropIfExists($this->tablePrefix.'user_settings'); |
|
| 36 | 36 | } |
| 37 | 37 | } |
@@ -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 | ]); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | }); |
| 41 | 41 | |
| 42 | 42 | // Delete uuid after forced delete |
| 43 | - static::deleted(function ($model) { |
|
| 43 | + static::deleted(function($model) { |
|
| 44 | 44 | if (!empty($model->uuid) && (!method_exists($model, 'isForceDeleting') || $model->isForceDeleting() === true)) { |
| 45 | 45 | $entity = Entity::find($model->uuid); |
| 46 | 46 | if ($entity) { |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | public function initializeUccelloModule() |
| 54 | 54 | { |
| 55 | - $this->appends = array_merge($this->appends, ['recordLabel','uuid']); |
|
| 55 | + $this->appends = array_merge($this->appends, [ 'recordLabel', 'uuid' ]); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | protected static function isFilteredByUser() |
@@ -84,15 +84,15 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | protected static function getModuleFromClass($className) |
| 86 | 86 | { |
| 87 | - $modules = Cache::rememberForever('modules_by_model_class', function () { |
|
| 87 | + $modules = Cache::rememberForever('modules_by_model_class', function() { |
|
| 88 | 88 | $modulesGroupedByModelClass = collect(); |
| 89 | - Module::all()->map(function ($item) use ($modulesGroupedByModelClass) { |
|
| 90 | - $modulesGroupedByModelClass[$item->model_class] = $item; |
|
| 89 | + Module::all()->map(function($item) use ($modulesGroupedByModelClass) { |
|
| 90 | + $modulesGroupedByModelClass[ $item->model_class ] = $item; |
|
| 91 | 91 | return $modulesGroupedByModelClass; |
| 92 | 92 | }); |
| 93 | 93 | return $modulesGroupedByModelClass; |
| 94 | 94 | }); |
| 95 | - return $modules[(string) $className] ?? null; |
|
| 95 | + return $modules[ (string)$className ] ?? null; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | public function getUuidAttribute() |
@@ -48,13 +48,13 @@ discard block |
||
| 48 | 48 | // Get filters |
| 49 | 49 | $filters = Filter::where('module_id', $module->id) // Module |
| 50 | 50 | ->where('type', 'list') // Type (list) |
| 51 | - ->where(function ($query) use($domain) { // Domain |
|
| 51 | + ->where(function($query) use($domain) { // Domain |
|
| 52 | 52 | $query->whereNull('domain_id') |
| 53 | 53 | ->orWhere('domain_id', $domain->getKey()); |
| 54 | 54 | }) |
| 55 | - ->where(function ($query) { // User |
|
| 55 | + ->where(function($query) { // User |
|
| 56 | 56 | $query->where('is_public', true) |
| 57 | - ->orWhere(function ($query) { |
|
| 57 | + ->orWhere(function($query) { |
|
| 58 | 58 | $query->where('is_public', false) |
| 59 | 59 | ->where('user_id', '=', auth()->id()); |
| 60 | 60 | }); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | ->get(); |
| 64 | 64 | |
| 65 | 65 | // Order |
| 66 | - $filterOrderBy = (array) $selectedFilter->order; |
|
| 66 | + $filterOrderBy = (array)$selectedFilter->order; |
|
| 67 | 67 | |
| 68 | 68 | // See descendants |
| 69 | 69 | $seeDescendants = request()->session()->get('descendants'); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | if ($relatedList && $relatedList->method) { |
| 133 | 133 | // Related list method |
| 134 | 134 | $method = $relatedList->method; |
| 135 | - $recordIdsMethod = $method . 'RecordIds'; |
|
| 135 | + $recordIdsMethod = $method.'RecordIds'; |
|
| 136 | 136 | |
| 137 | 137 | // Get related records ids |
| 138 | 138 | $model = new $modelClass; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | // Add the record id itself to be filtered |
| 142 | 142 | if ($relatedList->module_id === $relatedList->related_module_id && !empty($recordId) && !$filteredRecordIds->contains($recordId)) { |
| 143 | - $filteredRecordIds[] = (int)$recordId; |
|
| 143 | + $filteredRecordIds[ ] = (int)$recordId; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | // Make the quer |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $records = $query->paginate($length); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - $records->getCollection()->transform(function ($record) use ($domain, $module) { |
|
| 154 | + $records->getCollection()->transform(function($record) use ($domain, $module) { |
|
| 155 | 155 | foreach ($module->fields as $field) { |
| 156 | 156 | // If a special template exists, use it. Else use the generic template |
| 157 | 157 | $uitype = uitype($field->uitype_id); |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | $results = collect(); |
| 196 | 196 | if (method_exists($modelClass, 'getSearchResult') && property_exists($modelClass, 'searchableColumns')) { |
| 197 | 197 | $searchResults = new Search(); |
| 198 | - $searchResults->registerModel($modelClass, (array) (new $modelClass)->searchableColumns); |
|
| 198 | + $searchResults->registerModel($modelClass, (array)(new $modelClass)->searchableColumns); |
|
| 199 | 199 | $results = $searchResults->search($q)->take(config('uccello.max_results.autocomplete', 10)); |
| 200 | 200 | } |
| 201 | 201 | |
@@ -216,9 +216,9 @@ discard block |
||
| 216 | 216 | $savePageLength = $request->input('save_page_length'); |
| 217 | 217 | |
| 218 | 218 | // Optional data |
| 219 | - $data = []; |
|
| 219 | + $data = [ ]; |
|
| 220 | 220 | if ($savePageLength) { |
| 221 | - $data["length"] = $request->input('page_length'); |
|
| 221 | + $data[ "length" ] = $request->input('page_length'); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | $filter = Filter::firstOrNew([ |