@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | if (is_string($file)) { |
60 | 60 | $image_name = json_decode($file)->output->name; |
61 | 61 | $asset = $this->addAsset(json_decode($file)->output->image, $type, null, $image_name, $model); |
62 | - } else { |
|
62 | + }else { |
|
63 | 63 | $image_name = $file->getClientOriginalName(); |
64 | 64 | $asset = $this->addAsset($file, $type, null, $image_name, $model); |
65 | 65 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | if (is_string($file)) { |
84 | 84 | $asset = AssetUploader::uploadFromBase64($file, $filename); |
85 | - } else { |
|
85 | + }else { |
|
86 | 86 | $asset = AssetUploader::upload($file, $filename); |
87 | 87 | } |
88 | 88 | |
@@ -126,9 +126,9 @@ discard block |
||
126 | 126 | */ |
127 | 127 | private function sluggifyFilename($filename): string |
128 | 128 | { |
129 | - $extension = substr($filename, strrpos($filename, '.') + 1); |
|
129 | + $extension = substr($filename, strrpos($filename, '.')+1); |
|
130 | 130 | $filename = substr($filename, 0, strrpos($filename, '.')); |
131 | - $filename = str_slug($filename) . '.' . $extension; |
|
131 | + $filename = str_slug($filename).'.'.$extension; |
|
132 | 132 | |
133 | 133 | return $filename; |
134 | 134 | } |
@@ -144,9 +144,9 @@ discard block |
||
144 | 144 | if ($file instanceof UploadedFile && !$file->isValid()) { |
145 | 145 | if ($file->getError() == UPLOAD_ERR_INI_SIZE) { |
146 | 146 | throw new FileTooBigException( |
147 | - 'Cannot upload file because it exceeded the allowed upload_max_filesize: upload_max_filesize is smaller than post size. ' . |
|
148 | - 'upload_max_filesize: ' . (int)ini_get('upload_max_filesize') . 'MB, ' . |
|
149 | - 'post_max_size: ' . (int)(ini_get('post_max_size')) . 'MB' |
|
147 | + 'Cannot upload file because it exceeded the allowed upload_max_filesize: upload_max_filesize is smaller than post size. '. |
|
148 | + 'upload_max_filesize: '.(int)ini_get('upload_max_filesize').'MB, '. |
|
149 | + 'post_max_size: '.(int)(ini_get('post_max_size')).'MB' |
|
150 | 150 | ); |
151 | 151 | } |
152 | 152 | } |