From a61a3cf1e9df84b878e1035423b74ec5e26aa7c7 Mon Sep 17 00:00:00 2001 From: panabonic Date: Tue, 22 Aug 2023 17:18:49 +0300 Subject: [PATCH] minor fix --- app/Services/Registries/RegistryImportService.php | 5 ++++- .../migrations/2017_08_08_193843_create_assets_table.php | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/Services/Registries/RegistryImportService.php b/app/Services/Registries/RegistryImportService.php index d9d5a87..12bfdbb 100644 --- a/app/Services/Registries/RegistryImportService.php +++ b/app/Services/Registries/RegistryImportService.php @@ -31,7 +31,10 @@ class RegistryImportService { public function download($url, $dir = null, $filename = null): ?Asset { $urlInfo = parse_url($url); - if (empty($urlInfo['host'])) $url = str_replace('//', '/', "https://faufcc.ru/{$url}"); + if (empty($urlInfo['host'])) { + $url = str_replace('//', '/', "faufcc.ru/{$url}"); + $url = "https://{$url}"; + } $info = pathinfo($url); if ($info['extension'] ?? null) { $path = "public/documents/registries"; diff --git a/database/migrations/2017_08_08_193843_create_assets_table.php b/database/migrations/2017_08_08_193843_create_assets_table.php index 381f026..aaa8d3f 100644 --- a/database/migrations/2017_08_08_193843_create_assets_table.php +++ b/database/migrations/2017_08_08_193843_create_assets_table.php @@ -17,11 +17,11 @@ class CreateAssetsTable extends Migration $table->id(); $table->char('uuid', 36)->index()->unique(); $table->bigInteger('user_id')->unsigned()->index()->nullable(); - $table->string('name', 500)->index()->nullable(); + $table->string('name')->index()->nullable(); $table->string('type', 45)->index()->nullable(); - $table->string('path', 500)->nullable(); + $table->string('path')->nullable(); $table->string('mime')->nullable(); - $table->string('filename', 500)->index()->nullable(); + $table->string('filename')->index()->nullable(); $table->string('extension', 10)->index()->nullable(); $table->decimal('latitude', 8, 6)->nullable(); $table->decimal('longitude', 9, 6)->nullable();