@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | public function onFileAdded(array $newMediaItem): void |
73 | 73 | { |
74 | - if (! $this->allowsUpload($newMediaItem)) { |
|
74 | + if (!$this->allowsUpload($newMediaItem)) { |
|
75 | 75 | return; |
76 | 76 | } |
77 | 77 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | public function isReplacing(array $newMediaItem): bool |
120 | 120 | { |
121 | - if (! $newMediaItem['oldUuid']) { |
|
121 | + if (!$newMediaItem['oldUuid']) { |
|
122 | 122 | return false; |
123 | 123 | } |
124 | 124 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | public function hideError(string $uuid) |
130 | 130 | { |
131 | - if (! isset($this->media[$uuid])) { |
|
131 | + if (!isset($this->media[$uuid])) { |
|
132 | 132 | return; |
133 | 133 | } |
134 | 134 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | $errors = session()->get('errors'); |
145 | 145 | |
146 | - if (! $errors instanceof ViewErrorBag) { |
|
146 | + if (!$errors instanceof ViewErrorBag) { |
|
147 | 147 | return null; |
148 | 148 | } |
149 | 149 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | |
158 | 158 | public function onUploadError(string $uuid, string $uploadError) |
159 | 159 | { |
160 | - if (! isset($this->media[$uuid])) { |
|
160 | + if (!isset($this->media[$uuid])) { |
|
161 | 161 | return; |
162 | 162 | } |
163 | 163 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | $this->multiple = $multiple; |
46 | 46 | |
47 | - $this->uuid = $uuid ?? (string)Str::uuid(); |
|
47 | + $this->uuid = $uuid ?? (string) Str::uuid(); |
|
48 | 48 | |
49 | 49 | $this->add = $add; |
50 | 50 | } |
@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | { |
54 | 54 | $uploadError = $this->getUploadError(); |
55 | 55 | |
56 | - if (! is_null($uploadError)) { |
|
56 | + if (!is_null($uploadError)) { |
|
57 | 57 | $this->uploadError = $uploadError; |
58 | 58 | |
59 | - if (! $this->add) { |
|
59 | + if (!$this->add) { |
|
60 | 60 | $this->emit("{$this->name}:uploadError", $this->uuid, $uploadError); |
61 | 61 | } |
62 | 62 |
@@ -60,8 +60,8 @@ |
||
60 | 60 | protected function makeSureCustomPropertiesUseRightCasing(array $media): array |
61 | 61 | { |
62 | 62 | $media = collect($media) |
63 | - ->map(function (array $mediaItemAttributes) { |
|
64 | - if (! isset($mediaItemAttributes['custom_properties']) && isset($mediaItemAttributes['customProperties'])) { |
|
63 | + ->map(function(array $mediaItemAttributes) { |
|
64 | + if (!isset($mediaItemAttributes['custom_properties']) && isset($mediaItemAttributes['customProperties'])) { |
|
65 | 65 | $mediaItemAttributes['custom_properties'] = $mediaItemAttributes['customProperties']; |
66 | 66 | unset($mediaItemAttributes['customProperties']); |
67 | 67 | } |
@@ -23,19 +23,19 @@ |
||
23 | 23 | |
24 | 24 | /** @var \Spatie\MediaLibrary\MediaCollections\Models\Media $media */ |
25 | 25 | $media = $temporaryUpload->media()->create([ |
26 | - 'name' => $request->name, |
|
27 | - 'uuid' => $request->uuid, |
|
28 | - 'collection_name' => 'default', |
|
29 | - 'file_name' => $request->name, |
|
30 | - 'mime_type' => $request->content_type, |
|
31 | - 'disk' => $diskName, |
|
32 | - 'conversions_disk' => $diskName, |
|
33 | - 'manipulations' => [], |
|
34 | - 'custom_properties' => [], |
|
35 | - 'responsive_images' => [], |
|
36 | - 'generated_conversions' => [], |
|
37 | - 'size' => $request->size, |
|
38 | - ]); |
|
26 | + 'name' => $request->name, |
|
27 | + 'uuid' => $request->uuid, |
|
28 | + 'collection_name' => 'default', |
|
29 | + 'file_name' => $request->name, |
|
30 | + 'mime_type' => $request->content_type, |
|
31 | + 'disk' => $diskName, |
|
32 | + 'conversions_disk' => $diskName, |
|
33 | + 'manipulations' => [], |
|
34 | + 'custom_properties' => [], |
|
35 | + 'responsive_images' => [], |
|
36 | + 'generated_conversions' => [], |
|
37 | + 'size' => $request->size, |
|
38 | + ]); |
|
39 | 39 | |
40 | 40 | /** @var \Spatie\MediaLibrary\Support\PathGenerator\PathGenerator $pathGenerator */ |
41 | 41 | $pathGenerator = PathGeneratorFactory::create($media); |
@@ -42,7 +42,7 @@ |
||
42 | 42 | |
43 | 43 | Storage::disk($diskName)->copy( |
44 | 44 | $request->key, |
45 | - $pathGenerator->getPath($media) . $request->name, |
|
45 | + $pathGenerator->getPath($media).$request->name, |
|
46 | 46 | ); |
47 | 47 | |
48 | 48 | $fileManipulator->createDerivedFiles($media); |
@@ -18,11 +18,11 @@ |
||
18 | 18 | { |
19 | 19 | parent::boot(); |
20 | 20 | |
21 | - static::saving(function () { |
|
21 | + static::saving(function() { |
|
22 | 22 | self::cacheKey(); |
23 | 23 | }); |
24 | 24 | |
25 | - static::deleting(function () { |
|
25 | + static::deleting(function() { |
|
26 | 26 | self::cacheKey(); |
27 | 27 | }); |
28 | 28 | } |
@@ -18,11 +18,11 @@ |
||
18 | 18 | { |
19 | 19 | parent::boot(); |
20 | 20 | |
21 | - static::saving(function () { |
|
21 | + static::saving(function() { |
|
22 | 22 | self::cacheKey(); |
23 | 23 | }); |
24 | 24 | |
25 | - static::deleting(function () { |
|
25 | + static::deleting(function() { |
|
26 | 26 | self::cacheKey(); |
27 | 27 | }); |
28 | 28 | } |
@@ -18,11 +18,11 @@ |
||
18 | 18 | { |
19 | 19 | parent::boot(); |
20 | 20 | |
21 | - static::saving(function () { |
|
21 | + static::saving(function() { |
|
22 | 22 | self::cacheKey(); |
23 | 23 | }); |
24 | 24 | |
25 | - static::deleting(function () { |
|
25 | + static::deleting(function() { |
|
26 | 26 | self::cacheKey(); |
27 | 27 | }); |
28 | 28 | } |
@@ -18,11 +18,11 @@ |
||
18 | 18 | { |
19 | 19 | parent::boot(); |
20 | 20 | |
21 | - static::saving(function () { |
|
21 | + static::saving(function() { |
|
22 | 22 | self::cacheKey(); |
23 | 23 | }); |
24 | 24 | |
25 | - static::deleting(function () { |
|
25 | + static::deleting(function() { |
|
26 | 26 | self::cacheKey(); |
27 | 27 | }); |
28 | 28 | } |
@@ -18,11 +18,11 @@ |
||
18 | 18 | { |
19 | 19 | parent::boot(); |
20 | 20 | |
21 | - static::saving(function () { |
|
21 | + static::saving(function() { |
|
22 | 22 | self::cacheKey(); |
23 | 23 | }); |
24 | 24 | |
25 | - static::deleting(function () { |
|
25 | + static::deleting(function() { |
|
26 | 26 | self::cacheKey(); |
27 | 27 | }); |
28 | 28 | } |