@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | protected function saveFiles($model) |
20 | 20 | { |
21 | - if (! in_array(StorageTrait::class, class_uses($model))) { |
|
21 | + if (!in_array(StorageTrait::class, class_uses($model))) { |
|
22 | 22 | throw new InvalidArgumentException('The model you used does not use the Storage trait'); |
23 | 23 | } |
24 | 24 |
@@ -20,20 +20,20 @@ |
||
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 | $this->isNew = false; |
35 | 35 | } |
36 | - $ogSave = storage_path('app/public/'.$model->filesDir().'/original/').$fileName; |
|
36 | + $ogSave = storage_path('app/public/' . $model->filesDir() . '/original/') . $fileName; |
|
37 | 37 | try { |
38 | 38 | $imageManager->make($imageData)->save($ogSave); |
39 | 39 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | */ |
18 | 18 | protected function processImage(ImageManager $imageManager, $model) |
19 | 19 | { |
20 | - if (! in_array(StorageTrait::class, class_uses($model))) { |
|
20 | + if (!in_array(StorageTrait::class, class_uses($model))) { |
|
21 | 21 | throw new InvalidArgumentException('The model you used does not use the Storage trait'); |
22 | 22 | } |
23 | 23 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | try { |
35 | 35 | $thumbNail = $this->getImage($model->filesDir(), $image->name, $thumbNailsDimension); |
36 | 36 | $imageManager->make($originalFile)->fit($thumbNailsDimension, $thumbNailsDimension, |
37 | - function ($constraint) { |
|
37 | + function($constraint) { |
|
38 | 38 | $constraint->upsize(); |
39 | 39 | $constraint->aspectRatio(); |
40 | 40 | }, 'center')->save($thumbNail); |
@@ -53,9 +53,9 @@ |
||
53 | 53 | if ($this->image) { |
54 | 54 | if ($this->user->image()->exists()) { |
55 | 55 | $fileName = $this->user->image->name; |
56 | - $this->uploadImages($this->user, [$this->image], $imageManager, $fileName); |
|
56 | + $this->uploadImages($this->user, [ $this->image ], $imageManager, $fileName); |
|
57 | 57 | } else { |
58 | - $this->uploadImages($this->user, [$this->image], $imageManager); |
|
58 | + $this->uploadImages($this->user, [ $this->image ], $imageManager); |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | } |