@@ -20,22 +20,22 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | protected function uploadImages($model, array $images, ImageManager $imageManager, string $fileName = null) |
| 22 | 22 | { |
| 23 | - if (! in_array(StorageTrait::class, class_uses($model))) { |
|
| 23 | + if (!in_array(StorageTrait::class, class_uses($model))) { |
|
| 24 | 24 | throw new InvalidArgumentException('The model you used does not use the Storage trait'); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - if (! in_array(ImageableTrait::class, class_uses($model))) { |
|
| 27 | + if (!in_array(ImageableTrait::class, class_uses($model))) { |
|
| 28 | 28 | throw new InvalidArgumentException('The model you used does not use the Imageable trait'); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | foreach ($images as $imageData) { |
| 32 | - if (! $fileName) { |
|
| 33 | - $fileName = str_shuffle($model->id.time().time()).'.png'; |
|
| 32 | + if (!$fileName) { |
|
| 33 | + $fileName = str_shuffle($model->id . time() . time()) . '.png'; |
|
| 34 | 34 | } else { |
| 35 | 35 | $this->isNew = false; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - $ogSave = storage_path('app/public/'.$model->filesDir().'/original/').$fileName; |
|
| 38 | + $ogSave = storage_path('app/public/' . $model->filesDir() . '/original/') . $fileName; |
|
| 39 | 39 | |
| 40 | 40 | try { |
| 41 | 41 | $imageManager->make($imageData)->save($ogSave); |