@@ -115,9 +115,9 @@ discard block  | 
                                                    ||
| 115 | 115 | public function flatReferenceLabel(): string  | 
                                                        
| 116 | 116 |      { | 
                                                        
| 117 | 117 |          if ($this->exists) { | 
                                                        
| 118 | - $status = ! $this->isPublished() ? ' [' . $this->statusAsPlainLabel().']' : null;  | 
                                                        |
| 118 | + $status = !$this->isPublished() ? ' ['.$this->statusAsPlainLabel().']' : null;  | 
                                                        |
| 119 | 119 | |
| 120 | - return $this->title ? $this->title . $status : '';  | 
                                                        |
| 120 | + return $this->title ? $this->title.$status : '';  | 
                                                        |
| 121 | 121 | }  | 
                                                        
| 122 | 122 | |
| 123 | 123 | return '';  | 
                                                        
@@ -137,7 +137,7 @@ discard block  | 
                                                    ||
| 137 | 137 | // What was the creator of the assetlibrary package thinking. It sure wasn't me... I promise...  | 
                                                        
| 138 | 138 | $assets = $this->getAllFiles($type, app()->getLocale())->map->getFileUrl();  | 
                                                        
| 139 | 139 | |
| 140 | - if($assets->first() == null)  | 
                                                        |
| 140 | + if ($assets->first() == null)  | 
                                                        |
| 141 | 141 |          { | 
                                                        
| 142 | 142 | $assets = $this->getAllFiles($type)->map->getFileUrl();  | 
                                                        
| 143 | 143 | }  | 
                                                        
@@ -184,7 +184,7 @@ discard block  | 
                                                    ||
| 184 | 184 | return '';  | 
                                                        
| 185 | 185 | }  | 
                                                        
| 186 | 186 | |
| 187 | - $parameters = trim($this->baseUrlSegment($locale) . '/' . $slug, '/');  | 
                                                        |
| 187 | + $parameters = trim($this->baseUrlSegment($locale).'/'.$slug, '/');  | 
                                                        |
| 188 | 188 | |
| 189 | 189 | $routeName = Homepage::is($this)  | 
                                                        
| 190 | 190 |                          ? config('thinktomorrow.chief.routes.pages-home', 'pages.home') | 
                                                        
@@ -247,7 +247,7 @@ discard block  | 
                                                    ||
| 247 | 247 | ];  | 
                                                        
| 248 | 248 | |
| 249 | 249 |          foreach ($viewPaths as $viewPath) { | 
                                                        
| 250 | -            if (! view()->exists($viewPath)) { | 
                                                        |
| 250 | +            if (!view()->exists($viewPath)) { | 
                                                        |
| 251 | 251 | continue;  | 
                                                        
| 252 | 252 | }  | 
                                                        
| 253 | 253 | |
@@ -27,9 +27,9 @@ discard block  | 
                                                    ||
| 27 | 27 | //TODO check if trans key is present, if so we're saving translatable media  | 
                                                        
| 28 | 28 | |
| 29 | 29 |          foreach ($files_by_type as $type => $files) { | 
                                                        
| 30 | -            if(key_exists('trans', $files)) | 
                                                        |
| 30 | +            if (key_exists('trans', $files)) | 
                                                        |
| 31 | 31 |              { | 
                                                        
| 32 | - foreach($files['trans'] as $locale => $files)  | 
                                                        |
| 32 | + foreach ($files['trans'] as $locale => $files)  | 
                                                        |
| 33 | 33 |                  { | 
                                                        
| 34 | 34 | $this->validateFileUploads($files);  | 
                                                        
| 35 | 35 | |
@@ -40,7 +40,7 @@ discard block  | 
                                                    ||
| 40 | 40 | |
| 41 | 41 | $model->sortFiles($type, $files_order);  | 
                                                        
| 42 | 42 | }  | 
                                                        
| 43 | -            }else{ | 
                                                        |
| 43 | +            }else { | 
                                                        |
| 44 | 44 | $this->validateFileUploads($files);  | 
                                                        
| 45 | 45 | |
| 46 | 46 |                  $files_order = isset($files_order_by_type[$type]) ? explode(',', $files_order_by_type[$type]) : []; | 
                                                        
@@ -72,7 +72,7 @@ discard block  | 
                                                    ||
| 72 | 72 |          if (is_string($file)) { | 
                                                        
| 73 | 73 | $image_name = json_decode($file)->output->name;  | 
                                                        
| 74 | 74 | $asset = $this->addAsset(json_decode($file)->output->image, $type, $locale, $image_name, $model);  | 
                                                        
| 75 | -        } else { | 
                                                        |
| 75 | +        }else { | 
                                                        |
| 76 | 76 | $image_name = $file->getClientOriginalName();  | 
                                                        
| 77 | 77 | $asset = $this->addAsset($file, $type, $locale, $image_name, $model);  | 
                                                        
| 78 | 78 | }  | 
                                                        
@@ -95,7 +95,7 @@ discard block  | 
                                                    ||
| 95 | 95 | |
| 96 | 96 |          if (is_string($file)) { | 
                                                        
| 97 | 97 | $asset = AssetUploader::uploadFromBase64($file, $filename);  | 
                                                        
| 98 | -        } else { | 
                                                        |
| 98 | +        }else { | 
                                                        |
| 99 | 99 | $asset = AssetUploader::upload($file, $filename);  | 
                                                        
| 100 | 100 | }  | 
                                                        
| 101 | 101 | |
@@ -129,7 +129,7 @@ discard block  | 
                                                    ||
| 129 | 129 | private function removeFiles(HasMedia $model, array $files)  | 
                                                        
| 130 | 130 |      { | 
                                                        
| 131 | 131 |          if (isset($files['delete']) && is_array($files['delete']) && !empty($files['delete'])) { | 
                                                        
| 132 | -            foreach($model->assets()->whereIn('id', $files['delete'])->get() as $asset){ | 
                                                        |
| 132 | +            foreach ($model->assets()->whereIn('id', $files['delete'])->get() as $asset) { | 
                                                        |
| 133 | 133 | $asset->delete();  | 
                                                        
| 134 | 134 | }  | 
                                                        
| 135 | 135 | }  | 
                                                        
@@ -141,9 +141,9 @@ discard block  | 
                                                    ||
| 141 | 141 | */  | 
                                                        
| 142 | 142 | private function sluggifyFilename($filename): string  | 
                                                        
| 143 | 143 |      { | 
                                                        
| 144 | - $extension = substr($filename, strrpos($filename, '.') + 1);  | 
                                                        |
| 144 | + $extension = substr($filename, strrpos($filename, '.')+1);  | 
                                                        |
| 145 | 145 | $filename = substr($filename, 0, strrpos($filename, '.'));  | 
                                                        
| 146 | - $filename = str_slug($filename) . '.' . $extension;  | 
                                                        |
| 146 | + $filename = str_slug($filename).'.'.$extension;  | 
                                                        |
| 147 | 147 | |
| 148 | 148 | return $filename;  | 
                                                        
| 149 | 149 | }  | 
                                                        
@@ -159,9 +159,9 @@ discard block  | 
                                                    ||
| 159 | 159 |                  if ($file instanceof UploadedFile && !$file->isValid()) { | 
                                                        
| 160 | 160 |                      if ($file->getError() == UPLOAD_ERR_INI_SIZE) { | 
                                                        
| 161 | 161 | throw new FileTooBigException(  | 
                                                        
| 162 | - 'Cannot upload file because it exceeded the allowed upload_max_filesize: upload_max_filesize is smaller than post size. ' .  | 
                                                        |
| 163 | -                            'upload_max_filesize: ' . (int)ini_get('upload_max_filesize') . 'MB, ' . | 
                                                        |
| 164 | -                            'post_max_size: ' . (int)(ini_get('post_max_size')) . 'MB' | 
                                                        |
| 162 | + 'Cannot upload file because it exceeded the allowed upload_max_filesize: upload_max_filesize is smaller than post size. '.  | 
                                                        |
| 163 | +                            'upload_max_filesize: '.(int)ini_get('upload_max_filesize').'MB, '. | 
                                                        |
| 164 | +                            'post_max_size: '.(int)(ini_get('post_max_size')).'MB' | 
                                                        |
| 165 | 165 | );  | 
                                                        
| 166 | 166 | }  | 
                                                        
| 167 | 167 | }  | 
                                                        
@@ -40,7 +40,7 @@  | 
                                                    ||
| 40 | 40 | |
| 41 | 41 | $model->sortFiles($type, $files_order);  | 
                                                        
| 42 | 42 | }  | 
                                                        
| 43 | -            }else{ | 
                                                        |
| 43 | +            } else{ | 
                                                        |
| 44 | 44 | $this->validateFileUploads($files);  | 
                                                        
| 45 | 45 | |
| 46 | 46 |                  $files_order = isset($files_order_by_type[$type]) ? explode(',', $files_order_by_type[$type]) : []; |