@@ -116,10 +116,10 @@ discard block |
||
| 116 | 116 | return $filename; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - $extension = substr($filename, strrpos($filename, '.') + 1); |
|
| 119 | + $extension = substr($filename, strrpos($filename, '.')+1); |
|
| 120 | 120 | $filename = substr($filename, 0, strrpos($filename, '.')); |
| 121 | 121 | |
| 122 | - return Str::slug($filename) . '.' . $extension; |
|
| 122 | + return Str::slug($filename).'.'.$extension; |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | protected function sort(HasAsset $model, MediaField $field, Request $request) |
@@ -145,12 +145,12 @@ discard block |
||
| 145 | 145 | { |
| 146 | 146 | $values = isset($fileIdInput[$key]) |
| 147 | 147 | ? $fileIdInput[$key] |
| 148 | - : (isset($fileIdInput['files-' . $key]) |
|
| 149 | - ? $fileIdInput['files-' . $key] |
|
| 148 | + : (isset($fileIdInput['files-'.$key]) |
|
| 149 | + ? $fileIdInput['files-'.$key] |
|
| 150 | 150 | : '' |
| 151 | 151 | ); |
| 152 | 152 | |
| 153 | - if(!$values) return []; |
|
| 153 | + if (!$values) return []; |
|
| 154 | 154 | |
| 155 | 155 | return explode(',', $values); |
| 156 | 156 | } |
@@ -150,7 +150,9 @@ |
||
| 150 | 150 | : '' |
| 151 | 151 | ); |
| 152 | 152 | |
| 153 | - if(!$values) return []; |
|
| 153 | + if(!$values) { |
|
| 154 | + return []; |
|
| 155 | + } |
|
| 154 | 156 | |
| 155 | 157 | return explode(',', $values); |
| 156 | 158 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | // Custom set methods - default is the generic setField() method. |
| 32 | - $methodName = 'set' . ucfirst(Str::camel($field->getKey())) . 'Field'; |
|
| 32 | + $methodName = 'set'.ucfirst(Str::camel($field->getKey())).'Field'; |
|
| 33 | 33 | (method_exists($this, $methodName)) |
| 34 | 34 | ? $this->$methodName($field, $request) |
| 35 | 35 | : $this->setField($field, $request); |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | protected function detectCustomSaveMethods(Field $field): bool |
| 48 | 48 | { |
| 49 | - $saveMethodByKey = 'save' . ucfirst(Str::camel($field->getKey())) . 'Field'; |
|
| 50 | - $saveMethodByType = 'save' . ucfirst(Str::camel($field->getType()->get())) . 'Fields'; |
|
| 49 | + $saveMethodByKey = 'save'.ucfirst(Str::camel($field->getKey())).'Field'; |
|
| 50 | + $saveMethodByType = 'save'.ucfirst(Str::camel($field->getType()->get())).'Fields'; |
|
| 51 | 51 | |
| 52 | 52 | foreach ([$saveMethodByKey, $saveMethodByType] as $saveMethod) { |
| 53 | 53 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | // Make our media fields able to be translatable as well... |
| 97 | 97 | if ($field->ofType(FieldType::FILE, FieldType::IMAGE)) { |
| 98 | - throw new \Exception('Cannot process the ' . $field->getKey() . ' media field. Currently no support for translatable media files. We should fix this!'); |
|
| 98 | + throw new \Exception('Cannot process the '.$field->getKey().' media field. Currently no support for translatable media files. We should fix this!'); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | // Okay so this is a bit odd but since all translations are expected to be inside the trans |