@@ -317,7 +317,7 @@ |
||
| 317 | 317 | * @param string $method |
| 318 | 318 | * @param array $arguments |
| 319 | 319 | * |
| 320 | - * @return bool|mixed |
|
| 320 | + * @return Field |
|
| 321 | 321 | */ |
| 322 | 322 | public function __call($method, $arguments = []) |
| 323 | 323 | { |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | $this->overwriteExistingField($name); |
| 185 | 185 | |
| 186 | - return tap($field, function ($field) { |
|
| 186 | + return tap($field, function($field) { |
|
| 187 | 187 | $this->fields->push($field); |
| 188 | 188 | }); |
| 189 | 189 | } |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | $this->overwriteExistingRelation($name); |
| 207 | 207 | |
| 208 | - return tap($relation, function ($relation) { |
|
| 208 | + return tap($relation, function($relation) { |
|
| 209 | 209 | $this->relations->push($relation); |
| 210 | 210 | }); |
| 211 | 211 | } |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | $this->fields = $this->fields->filter( |
| 225 | - function (Field $field) use ($name) { |
|
| 225 | + function(Field $field) use ($name) { |
|
| 226 | 226 | return $field->getName() != $name; |
| 227 | 227 | } |
| 228 | 228 | ); |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | $this->relations = $this->relations->filter( |
| 243 | - function (Relation $relation) use ($name) { |
|
| 243 | + function(Relation $relation) use ($name) { |
|
| 244 | 244 | return $relation->getName() != $name; |
| 245 | 245 | } |
| 246 | 246 | ); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | /** |
| 89 | 89 | * Get name of this column. |
| 90 | 90 | * |
| 91 | - * @return mixed |
|
| 91 | + * @return string |
|
| 92 | 92 | */ |
| 93 | 93 | public function getName() |
| 94 | 94 | { |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | /** |
| 113 | 113 | * Get label of the column. |
| 114 | 114 | * |
| 115 | - * @return mixed |
|
| 115 | + * @return string |
|
| 116 | 116 | */ |
| 117 | 117 | public function getLabel() |
| 118 | 118 | { |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function using(array $values, $default = null) |
| 145 | 145 | { |
| 146 | - return $this->as(function ($value) use ($values, $default) { |
|
| 146 | + return $this->as(function($value) use ($values, $default) { |
|
| 147 | 147 | if (is_null($value)) { |
| 148 | 148 | return $default; |
| 149 | 149 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | public function image($server = '', $width = 200, $height = 200) |
| 165 | 165 | { |
| 166 | - return $this->as(function ($path) use ($server, $width, $height) { |
|
| 166 | + return $this->as(function($path) use ($server, $width, $height) { |
|
| 167 | 167 | if (url()->isValidUrl($path)) { |
| 168 | 168 | $src = $path; |
| 169 | 169 | } elseif ($server) { |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | */ |
| 187 | 187 | public function link($href = '', $target = '_blank') |
| 188 | 188 | { |
| 189 | - return $this->as(function ($link) use ($href, $target) { |
|
| 189 | + return $this->as(function($link) use ($href, $target) { |
|
| 190 | 190 | $href = $href ?: $link; |
| 191 | 191 | |
| 192 | 192 | return "<a href='$href' target='{$target}'>{$link}</a>"; |
@@ -202,12 +202,12 @@ discard block |
||
| 202 | 202 | */ |
| 203 | 203 | public function label($style = 'success') |
| 204 | 204 | { |
| 205 | - return $this->as(function ($value) use ($style) { |
|
| 205 | + return $this->as(function($value) use ($style) { |
|
| 206 | 206 | if ($value instanceof Arrayable) { |
| 207 | 207 | $value = $value->toArray(); |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - return collect((array) $value)->map(function ($name) use ($style) { |
|
| 210 | + return collect((array) $value)->map(function($name) use ($style) { |
|
| 211 | 211 | return "<span class='label label-{$style}'>$name</span>"; |
| 212 | 212 | })->implode(' '); |
| 213 | 213 | }); |
@@ -222,12 +222,12 @@ discard block |
||
| 222 | 222 | */ |
| 223 | 223 | public function badge($style = 'blue') |
| 224 | 224 | { |
| 225 | - return $this->as(function ($value) use ($style) { |
|
| 225 | + return $this->as(function($value) use ($style) { |
|
| 226 | 226 | if ($value instanceof Arrayable) { |
| 227 | 227 | $value = $value->toArray(); |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - return collect((array) $value)->map(function ($name) use ($style) { |
|
| 230 | + return collect((array) $value)->map(function($name) use ($style) { |
|
| 231 | 231 | return "<span class='badge bg-{$style}'>$name</span>"; |
| 232 | 232 | })->implode(' '); |
| 233 | 233 | }); |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | public function render() |
| 294 | 294 | { |
| 295 | 295 | if ($this->showAs->isNotEmpty()) { |
| 296 | - $this->showAs->each(function ($callable) { |
|
| 296 | + $this->showAs->each(function($callable) { |
|
| 297 | 297 | $this->value = $callable->call( |
| 298 | 298 | $this->parent->getModel(), |
| 299 | 299 | $this->value |
@@ -138,7 +138,7 @@ |
||
| 138 | 138 | /** |
| 139 | 139 | * Fill fields to panel. |
| 140 | 140 | * |
| 141 | - * @param []Field $fields |
|
| 141 | + * @param Collection $fields |
|
| 142 | 142 | * |
| 143 | 143 | * @return $this |
| 144 | 144 | */ |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | /** |
| 53 | 53 | * Add a batch action. |
| 54 | 54 | * |
| 55 | - * @param $title |
|
| 55 | + * @param BatchDelete $title |
|
| 56 | 56 | * @param BatchAction|null $action |
| 57 | 57 | * |
| 58 | 58 | * @return $this |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | { |
| 208 | 208 | $inputs = array_dot(Input::all()); |
| 209 | 209 | |
| 210 | - $inputs = array_filter($inputs, function ($input) { |
|
| 210 | + $inputs = array_filter($inputs, function($input) { |
|
| 211 | 211 | return $input !== '' && !is_null($input); |
| 212 | 212 | }); |
| 213 | 213 | |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | $conditions[] = $filter->condition($params); |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - return tap(array_filter($conditions), function ($conditions) { |
|
| 234 | + return tap(array_filter($conditions), function($conditions) { |
|
| 235 | 235 | $this->searching = !empty($conditions); |
| 236 | 236 | }); |
| 237 | 237 | } |
@@ -247,9 +247,9 @@ discard block |
||
| 247 | 247 | return $inputs; |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | - $inputs = collect($inputs)->filter(function ($input, $key) { |
|
| 250 | + $inputs = collect($inputs)->filter(function($input, $key) { |
|
| 251 | 251 | return starts_with($key, "{$this->name}_"); |
| 252 | - })->mapWithKeys(function ($val, $key) { |
|
| 252 | + })->mapWithKeys(function($val, $key) { |
|
| 253 | 253 | $key = str_replace("{$this->name}_", '', $key); |
| 254 | 254 | |
| 255 | 255 | return [$key => $val]; |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | */ |
| 300 | 300 | public function scope($key, $label = '') |
| 301 | 301 | { |
| 302 | - return tap(new Scope($key, $label), function (Scope $scope) { |
|
| 302 | + return tap(new Scope($key, $label), function(Scope $scope) { |
|
| 303 | 303 | return $this->scopes->push($scope); |
| 304 | 304 | }); |
| 305 | 305 | } |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | { |
| 324 | 324 | $key = request(Scope::QUERY_NAME); |
| 325 | 325 | |
| 326 | - return $this->scopes->first(function ($scope) use ($key) { |
|
| 326 | + return $this->scopes->first(function($scope) use ($key) { |
|
| 327 | 327 | return $scope->key == $key; |
| 328 | 328 | }); |
| 329 | 329 | } |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | */ |
| 56 | 56 | public function condition() |
| 57 | 57 | { |
| 58 | - return $this->queries->map(function ($query) { |
|
| 58 | + return $this->queries->map(function($query) { |
|
| 59 | 59 | return [$query['method'] => $query['arguments']]; |
| 60 | 60 | })->toArray(); |
| 61 | 61 | } |