@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | public function domains() |
| 48 | 48 | { |
| 49 | - return $this->belongsToMany(Domain::class, $this->tablePrefix . 'domains_modules'); |
|
| 49 | + return $this->belongsToMany(Domain::class, $this->tablePrefix.'domains_modules'); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | public function tabs() |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | public function getMenuLinksAttribute() : array |
| 117 | 117 | { |
| 118 | - $menuLinks = []; |
|
| 118 | + $menuLinks = [ ]; |
|
| 119 | 119 | |
| 120 | 120 | //TODO: Adds capability needed |
| 121 | 121 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $link->label = $this->name; |
| 127 | 127 | $link->route = $this->data->menu; |
| 128 | 128 | $link->icon = $this->icon; |
| 129 | - $menuLinks[] = $link; |
|
| 129 | + $menuLinks[ ] = $link; |
|
| 130 | 130 | } |
| 131 | 131 | // Several routes |
| 132 | 132 | elseif (is_array($this->data->menu)) { |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | if (empty($link->icon)) { |
| 135 | 135 | $link->icon = $this->icon; |
| 136 | 136 | } |
| 137 | - $menuLinks[] = $link; |
|
| 137 | + $menuLinks[ ] = $link; |
|
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | // No route wanted |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $link->label = $this->name; |
| 149 | 149 | $link->route = 'uccello.list'; |
| 150 | 150 | $link->icon = $this->icon; |
| 151 | - $menuLinks[] = $link; |
|
| 151 | + $menuLinks[ ] = $link; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | return $menuLinks; |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | * @param Module|null $module |
| 64 | 64 | * @return string|null |
| 65 | 65 | */ |
| 66 | - public function getFormattedValueToSave(Request $request, Field $field, $value, $record=null, ?Domain $domain=null, ?Module $module=null) : ?string |
|
| 66 | + public function getFormattedValueToSave(Request $request, Field $field, $value, $record = null, ?Domain $domain = null, ?Module $module = null) : ?string |
|
| 67 | 67 | { |
| 68 | 68 | $uitypeClass = $this->class; |
| 69 | 69 | return (new $uitypeClass())->getFormattedValueToSave($request, $field, $value, $record, $domain, $module); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | * |
| 22 | 22 | * @var array |
| 23 | 23 | */ |
| 24 | - protected $dates = ['deleted_at']; |
|
| 24 | + protected $dates = [ 'deleted_at' ]; |
|
| 25 | 25 | |
| 26 | 26 | protected function initTablePrefix() |
| 27 | 27 | { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | public function profiles() |
| 52 | 52 | { |
| 53 | - return $this->belongsToMany(Profile::class, $this->tablePrefix . 'profiles_roles'); |
|
| 53 | + return $this->belongsToMany(Profile::class, $this->tablePrefix.'profiles_roles'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * |
| 28 | 28 | * @var array |
| 29 | 29 | */ |
| 30 | - protected $dates = ['deleted_at']; |
|
| 30 | + protected $dates = [ 'deleted_at' ]; |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * The attributes that are mass assignable. |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function getJWTCustomClaims() |
| 86 | 86 | { |
| 87 | - return []; |
|
| 87 | + return [ ]; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function getRecordLabelAttribute() : string |
| 96 | 96 | { |
| 97 | - return trim($this->first_name . ' ' .$this->last_name) ?? $this->username; |
|
| 97 | + return trim($this->first_name.' '.$this->last_name) ?? $this->username; |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | // public function getAccessibleDomainsAttribute() : Collection |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $roles = new Collection(); |
| 122 | 122 | |
| 123 | 123 | foreach ($this->privileges->where('domain_id', $domain->id) as $privilege) { |
| 124 | - $roles[] = $privilege->role; |
|
| 124 | + $roles[ ] = $privilege->role; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | return $roles; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | * |
| 25 | 25 | * @var array |
| 26 | 26 | */ |
| 27 | - protected $dates = ['deleted_at']; |
|
| 27 | + protected $dates = [ 'deleted_at' ]; |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * The attributes that should be casted to native types. |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | public function modules() |
| 90 | 90 | { |
| 91 | - return $this->belongsToMany(Module::class, $this->tablePrefix . 'domains_modules'); |
|
| 91 | + return $this->belongsToMany(Module::class, $this->tablePrefix.'domains_modules'); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | public function menus() |
@@ -102,19 +102,19 @@ discard block |
||
| 102 | 102 | * @param boolean $includeItself |
| 103 | 103 | * @return Collection |
| 104 | 104 | */ |
| 105 | - public function parents($includeItself=true) : Collection |
|
| 105 | + public function parents($includeItself = true) : Collection |
|
| 106 | 106 | { |
| 107 | 107 | $parents = new Collection(); |
| 108 | 108 | |
| 109 | 109 | if ($includeItself) { |
| 110 | - $parents[] = $this; |
|
| 110 | + $parents[ ] = $this; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | $domain = $this; |
| 114 | 114 | |
| 115 | 115 | while (!is_null($domain->parent)) { |
| 116 | 116 | $domain = $domain->parent; |
| 117 | - $parents[] = $domain; |
|
| 117 | + $parents[ ] = $domain; |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | return $parents; |
@@ -137,11 +137,11 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | protected function getAdminModulesAttribute() : array |
| 139 | 139 | { |
| 140 | - $modules = []; |
|
| 140 | + $modules = [ ]; |
|
| 141 | 141 | |
| 142 | 142 | foreach ($this->modules()->get() as $module) { |
| 143 | 143 | if ($module->isAdminModule()) { |
| 144 | - $modules[] = $module; |
|
| 144 | + $modules[ ] = $module; |
|
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | |
@@ -155,11 +155,11 @@ discard block |
||
| 155 | 155 | */ |
| 156 | 156 | protected function getNotAdminModulesAttribute() : array |
| 157 | 157 | { |
| 158 | - $modules = []; |
|
| 158 | + $modules = [ ]; |
|
| 159 | 159 | |
| 160 | 160 | foreach ($this->modules()->get() as $module) { |
| 161 | 161 | if (!$module->isAdminModule()) { |
| 162 | - $modules[] = $module; |
|
| 162 | + $modules[ ] = $module; |
|
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | * |
| 29 | 29 | * @return void |
| 30 | 30 | */ |
| 31 | - public function __construct(Domain $domain, Module $module, Request $request, $record, $isFromApi=false) |
|
| 31 | + public function __construct(Domain $domain, Module $module, Request $request, $record, $isFromApi = false) |
|
| 32 | 32 | { |
| 33 | 33 | $this->domain = $domain; |
| 34 | 34 | $this->module = $module; |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | * |
| 30 | 30 | * @return void |
| 31 | 31 | */ |
| 32 | - public function __construct(Domain $domain, Module $module, Request $request, $record, $mode=null, $isFromApi=false) |
|
| 32 | + public function __construct(Domain $domain, Module $module, Request $request, $record, $mode = null, $isFromApi = false) |
|
| 33 | 33 | { |
| 34 | 34 | $this->domain = $domain; |
| 35 | 35 | $this->module = $module; |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | * |
| 29 | 29 | * @return void |
| 30 | 30 | */ |
| 31 | - public function __construct(Domain $domain, Module $module, Request $request, $record, $isFromApi=false) |
|
| 31 | + public function __construct(Domain $domain, Module $module, Request $request, $record, $isFromApi = false) |
|
| 32 | 32 | { |
| 33 | 33 | $this->domain = $domain; |
| 34 | 34 | $this->module = $module; |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | * |
| 30 | 30 | * @return void |
| 31 | 31 | */ |
| 32 | - public function __construct(Domain $domain, ?Module $module, ?Request $request, $record, $mode=null, $isFromApi=false) |
|
| 32 | + public function __construct(Domain $domain, ?Module $module, ?Request $request, $record, $mode = null, $isFromApi = false) |
|
| 33 | 33 | { |
| 34 | 34 | $this->domain = $domain; |
| 35 | 35 | $this->module = $module; |