From 5095a7b7ddb2cd68ec30def48094e8549322e114 Mon Sep 17 00:00:00 2001 From: Masroor Ehsan Date: Tue, 31 Dec 2024 16:51:28 +0600 Subject: [PATCH] replaced league with spatie url --- app/Services/Pacs/PacsUrlGen.php | 36 ++++++++++++++++---------------- composer.json | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/Services/Pacs/PacsUrlGen.php b/app/Services/Pacs/PacsUrlGen.php index 4c6ef32..70e8430 100644 --- a/app/Services/Pacs/PacsUrlGen.php +++ b/app/Services/Pacs/PacsUrlGen.php @@ -2,53 +2,53 @@ namespace App\Services\Pacs; -use League\Url\Url; +use Spatie\Url\Url; final class PacsUrlGen { public static function stoneViewer(string $study_uid): string { - $url = Url::createFromUrl(config('pacs.viewer.stone.endpoint')); - $url->setPath('/stone-webviewer/index.html'); - $url->setQuery(['study' => $study_uid]); + $url = Url::fromString(config('pacs.viewer.stone.endpoint')) + ->withPath('/stone-webviewer/index.html') + ->withQueryParameters(['study' => $study_uid]); return (string) $url; } public static function ohifViewer(string $study_uid): string { - $url = Url::createFromUrl(config('pacs.viewer.ohif.endpoint')); - $url->setPath('/ohif/viewer'); - $url->setQuery(['StudyInstanceUIDs' => $study_uid]); + $url = Url::fromString(config('pacs.viewer.ohif.endpoint')) + ->withPath('/ohif/viewer') + ->withQueryParameters(['StudyInstanceUIDs' => $study_uid]); return (string) $url; } public static function ohifViewerMpr(string $study_uid): string { - $url = Url::createFromUrl(config('pacs.viewer.ohif.endpoint')); - $url->setPath('/ohif/viewer'); - $url->setQuery([ - 'hangingprotocolId' => 'mprAnd3DVolumeViewport', - 'StudyInstanceUIDs' => $study_uid, - ]); + $url = Url::fromString(config('pacs.viewer.ohif.endpoint')) + ->withPath('/ohif/viewer') + ->withQueryParameters([ + 'hangingprotocolId' => 'mprAnd3DVolumeViewport', + 'StudyInstanceUIDs' => $study_uid, + ]); return (string) $url; } public static function ohifSegmentation(string $study_uid): string { - $url = Url::createFromUrl(config('pacs.viewer.ohif.endpoint')); - $url->setPath('/ohif/segmentation'); - $url->setQuery(['StudyInstanceUIDs' => $study_uid]); + $url = Url::fromString(config('pacs.viewer.ohif.endpoint')) + ->withPath('/ohif/segmentation') + ->withQueryParameters(['StudyInstanceUIDs' => $study_uid]); return (string) $url; } public static function archive(string $study_uid): string { - $url = Url::createFromUrl(config('pacs.api.endpoint')); - $url->setPath('/studies/'.$study_uid.'/archive'); + $url = Url::fromString(config('pacs.api.endpoint')) + ->withPath('/studies/'.$study_uid.'/archive'); return (string) $url; } diff --git a/composer.json b/composer.json index 25b7780..f7b1d5a 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,6 @@ "laravel/jetstream": "^5.3", "laravel/sanctum": "^4.0", "laravel/tinker": "^2.9", - "league/url": "^3.3", "livewire/livewire": "^3.0", "phpoffice/phpword": "^1.3", "propaganistas/laravel-phone": "^5.3", @@ -22,6 +21,7 @@ "rawilk/laravel-settings": "^3.4", "sentry/sentry-laravel": "^4.10", "spatie/laravel-permission": "^6.10", + "spatie/url": "^2.4", "vinkla/hashids": "^12.0", "yajra/laravel-datatables-oracle": "^11.1" },