diff --git a/app/Http/helpers.php b/app/Http/helpers.php index 6c36db3b..d9536e86 100644 --- a/app/Http/helpers.php +++ b/app/Http/helpers.php @@ -290,14 +290,20 @@ function store_avatar($request, $name) // Store avatar $image_path = Str::random(16) . '-' . $image->getClientOriginalName(); - // Create intervention image - $img = Image::make($image->getRealPath()); + if (in_array($image->getClientMimeType(), ['image/gif', 'image/jpeg', 'image/jpg', 'image/png', 'image/webp'])) { + // Create intervention image + $img = Image::make($image->getRealPath()); - // Generate thumbnail - $img->fit('150', '150')->stream(); + // Generate thumbnail + $img->fit('150', '150')->stream(); - // Store thumbnail to disk - Storage::put("avatars/$image_path", $img); + // Store thumbnail to disk + Storage::put("avatars/$image_path", $img); + } + + if ($image->getClientMimeType() === 'image/svg+xml') { + Storage::putFileAs('avatars', $image, $image_path); + } // Return path to image return "avatars/$image_path"; diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 3edc51b8..9572b0a5 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -20,7 +20,7 @@ "/chunks/app-language.js": "/chunks/app-language.js?id=ccf2292ad048d4bfad60", "/chunks/app-language~chunks/app-settings~chunks/dashboard~chunks/dashboard-oasis~chunks/invoices~chun~93101a7f.js": "/chunks/app-language~chunks/app-settings~chunks/dashboard~chunks/dashboard-oasis~chunks/invoices~chun~93101a7f.js?id=93fb27b76209e5b7b2d9", "/chunks/app-language~chunks/dashboard~chunks/dashboard-oasis~chunks/files~chunks/invoices~chunks/oasi~c6e9de01.js": "/chunks/app-language~chunks/dashboard~chunks/dashboard-oasis~chunks/files~chunks/invoices~chunks/oasi~c6e9de01.js?id=f9af3b7905bb7c35023d", - "/chunks/app-others.js": "/chunks/app-others.js?id=9156adba3b1697a8bf3e", + "/chunks/app-others.js": "/chunks/app-others.js?id=98970c52f69ab8ae1bc9", "/chunks/app-payments.js": "/chunks/app-payments.js?id=7e1a982c90174f568fb2", "/chunks/app-settings.js": "/chunks/app-settings.js?id=acc6ba7a93681f0d5d64", "/chunks/app-setup.js": "/chunks/app-setup.js?id=d0e3e046e147ca928f34", @@ -421,5 +421,11 @@ "/chunks/platform~chunks/shared.6c21d61908391d289fde.hot-update.js": "/chunks/platform~chunks/shared.6c21d61908391d289fde.hot-update.js", "/chunks/platform~chunks/shared.1107858fead4e99c0777.hot-update.js": "/chunks/platform~chunks/shared.1107858fead4e99c0777.hot-update.js", "/chunks/platform~chunks/shared.8ecbc2534cc15edb24c7.hot-update.js": "/chunks/platform~chunks/shared.8ecbc2534cc15edb24c7.hot-update.js", - "/chunks/platform~chunks/shared.726c307ce12d01d3d14b.hot-update.js": "/chunks/platform~chunks/shared.726c307ce12d01d3d14b.hot-update.js" + "/chunks/platform~chunks/shared.726c307ce12d01d3d14b.hot-update.js": "/chunks/platform~chunks/shared.726c307ce12d01d3d14b.hot-update.js", + "/js/main.1342e30369dc66c18368.hot-update.js": "/js/main.1342e30369dc66c18368.hot-update.js", + "/chunks/app-others.1c89c0d9ff0756cf8526.hot-update.js": "/chunks/app-others.1c89c0d9ff0756cf8526.hot-update.js", + "/js/main.6e42083eb30e9061f9f1.hot-update.js": "/js/main.6e42083eb30e9061f9f1.hot-update.js", + "/js/main.eee1ffd3fe3caa473ed0.hot-update.js": "/js/main.eee1ffd3fe3caa473ed0.hot-update.js", + "/js/main.168fcbb1cfee63eab722.hot-update.js": "/js/main.168fcbb1cfee63eab722.hot-update.js", + "/js/main.677f002e2ff871016185.hot-update.js": "/js/main.677f002e2ff871016185.hot-update.js" } diff --git a/resources/js/helpers.js b/resources/js/helpers.js index be682745..a988a38b 100644 --- a/resources/js/helpers.js +++ b/resources/js/helpers.js @@ -29,11 +29,9 @@ const Helpers = { } }, 300) - Vue.prototype.$updateText = debounce(function (route, name, value) { + Vue.prototype.$updateText = debounce(function (route, name, value, allowEmpty = false) { - let enableEmptyInput = ['mimetypes_blacklist', 'google_analytics', 'upload_limit'] - - if (value === '' || value === ' ' && !enableEmptyInput.includes(name)) return + if ((value === '' || value === ' ') && !allowEmpty) return axios.post(this.$store.getters.api + route, {name, value, _method: 'patch'}) .catch(() => { diff --git a/resources/js/views/Admin/AppSettings/AppSettingsTabs/Others.vue b/resources/js/views/Admin/AppSettings/AppSettingsTabs/Others.vue index e124eb2c..581a6bf3 100644 --- a/resources/js/views/Admin/AppSettings/AppSettingsTabs/Others.vue +++ b/resources/js/views/Admin/AppSettings/AppSettingsTabs/Others.vue @@ -74,7 +74,7 @@ {{ $t('admin_settings.others.google_analytics') }}: - {{ errors[0] }} @@ -84,7 +84,7 @@ {{ $t('admin_settings.others.mimetypes_blacklist') }}: - + {{ errors[0] }} @@ -93,7 +93,7 @@ {{ $t('admin_settings.others.upload_limit') }}: - + {{ errors[0] }}