@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | $query = $request->get('term'); |
| 121 | 121 | $fieldName = $request->get('field'); |
| 122 | - $page = (int) $request->get('page'); |
|
| 122 | + $page = (int)$request->get('page'); |
|
| 123 | 123 | |
| 124 | 124 | /** @var Select $field */ |
| 125 | 125 | $field = $this->crud()->getFieldByName($fieldName); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $options = $field->getOptions($page, $perPage, $query, $total, $index); |
| 135 | 135 | array_walk($options, function(&$item, $key) use($group) { |
| 136 | 136 | $item = [ |
| 137 | - 'id' => crc32($group['group']) .'~~~'. $key, |
|
| 137 | + 'id' => crc32($group['group']).'~~~'.$key, |
|
| 138 | 138 | 'text' => $item, |
| 139 | 139 | ]; |
| 140 | 140 | }); |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | $formRequest = new $formRequestClass(); |
| 283 | 283 | if (method_exists($formRequest, 'rules')) { |
| 284 | 284 | foreach ($formRequest->rules() as $param => $paramRules) { |
| 285 | - if (preg_match('~^'. preg_quote($name) .'(\.\*)?$~', $param)) { |
|
| 285 | + if (preg_match('~^'.preg_quote($name).'(\.\*)?$~', $param)) { |
|
| 286 | 286 | return [ |
| 287 | 287 | $paramRules, |
| 288 | 288 | $formRequest->messages(), |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | $this->init(); |
| 381 | 381 | $this->bound(); |
| 382 | 382 | |
| 383 | - $this->crud()->setPerPageParam((int) $perPage); |
|
| 383 | + $this->crud()->setPerPageParam((int)$perPage); |
|
| 384 | 384 | |
| 385 | 385 | return redirect($this->crud()->listUrl()); |
| 386 | 386 | } |
@@ -882,11 +882,11 @@ discard block |
||
| 882 | 882 | return $this->handleInline($request); |
| 883 | 883 | |
| 884 | 884 | default: |
| 885 | - throw new \RuntimeException('Invalid method ' . $name); |
|
| 885 | + throw new \RuntimeException('Invalid method '.$name); |
|
| 886 | 886 | } |
| 887 | 887 | } catch (ValidationException $e) { |
| 888 | 888 | throw $e; |
| 889 | - } catch(UnauthorizedException $e) { |
|
| 889 | + } catch (UnauthorizedException $e) { |
|
| 890 | 890 | return $this->createUnauthorizedResponse($request, $e); |
| 891 | 891 | } catch (\Exception $e) { |
| 892 | 892 | return redirect() |
@@ -962,7 +962,7 @@ discard block |
||
| 962 | 962 | */ |
| 963 | 963 | protected function notify(string $title, string $content = null, int $timeout = 4000, string $color = null, string $icon = null, string $type = 'small') |
| 964 | 964 | { |
| 965 | - $ident = 'jarboe_notifications.'. $type; |
|
| 965 | + $ident = 'jarboe_notifications.'.$type; |
|
| 966 | 966 | |
| 967 | 967 | $messages = session()->get($ident, []); |
| 968 | 968 | $messages[] = [ |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | if ($this->hasOld()) { |
| 28 | 28 | if ($this->isGroupedRelation()) { |
| 29 | - $option = crc32($this->relations[$relationIndex]['group']) .'~~~'. $option; |
|
| 29 | + $option = crc32($this->relations[$relationIndex]['group']).'~~~'.$option; |
|
| 30 | 30 | } |
| 31 | 31 | return $this->old() == $option; |
| 32 | 32 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | { |
| 105 | 105 | $template = $this->isReadonly() ? 'readonly' : 'edit'; |
| 106 | 106 | |
| 107 | - return view('jarboe::crud.fields.radio.'. $template, [ |
|
| 107 | + return view('jarboe::crud.fields.radio.'.$template, [ |
|
| 108 | 108 | 'model' => $model, |
| 109 | 109 | 'field' => $this, |
| 110 | 110 | ])->render(); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | { |
| 83 | 83 | if ($this->hasOld()) { |
| 84 | 84 | if ($this->isGroupedRelation()) { |
| 85 | - $option = crc32($this->relations[$relationIndex]['group']) .'~~~'. $option; |
|
| 85 | + $option = crc32($this->relations[$relationIndex]['group']).'~~~'.$option; |
|
| 86 | 86 | } |
| 87 | 87 | if ($this->isMultiple()) { |
| 88 | 88 | return in_array($option, $this->old()); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | if (is_null($model)) { |
| 94 | - return (string) $option === (string) $this->getDefault(); |
|
| 94 | + return (string)$option === (string)$this->getDefault(); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | if ($this->isMultiple() && !$this->isRelationField()) { |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | return false; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - return (string) $option === (string) $model->{$this->name}; |
|
| 116 | + return (string)$option === (string)$model->{$this->name}; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | public function relationSearch(\Closure $callback) |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | { |
| 175 | 175 | $template = $this->isReadonly() ? 'readonly' : 'edit'; |
| 176 | 176 | |
| 177 | - return view('jarboe::crud.fields.select.'. $template, [ |
|
| 177 | + return view('jarboe::crud.fields.select.'.$template, [ |
|
| 178 | 178 | 'model' => $model, |
| 179 | 179 | 'field' => $this, |
| 180 | 180 | ])->render(); |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | { |
| 192 | 192 | $filtered = []; |
| 193 | 193 | foreach ($ids as $id) { |
| 194 | - if (strpos($id, $relationHash .'~~~') !== false) { |
|
| 194 | + if (strpos($id, $relationHash.'~~~') !== false) { |
|
| 195 | 195 | $id = substr($id, 13); |
| 196 | 196 | $filtered[] = $id; |
| 197 | 197 | } |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | public function getSelectedOptions(array $values, int $index = 0): array |
| 78 | 78 | { |
| 79 | 79 | $total = 0; |
| 80 | - $options = $this->field()->getOptions(null, null, null, $total, $index, function ($query, $related) use ($values) { |
|
| 81 | - $query->whereIn($related->getTable() .'.'. $related->getKeyName(), $values); |
|
| 80 | + $options = $this->field()->getOptions(null, null, null, $total, $index, function($query, $related) use ($values) { |
|
| 81 | + $query->whereIn($related->getTable().'.'.$related->getKeyName(), $values); |
|
| 82 | 82 | }); |
| 83 | 83 | |
| 84 | 84 | return $options; |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | $relationClass = new $relationClass; |
| 164 | 164 | |
| 165 | 165 | $query->whereHas($this->field()->getRelationMethod($index), function($query) use($values, $relationClass, $relationQuery) { |
| 166 | - $query->whereIn($relationQuery->getTable() .'.'. $relationClass->getKeyName(), $values); |
|
| 166 | + $query->whereIn($relationQuery->getTable().'.'.$relationClass->getKeyName(), $values); |
|
| 167 | 167 | }); |
| 168 | 168 | } |
| 169 | 169 | } |