From 4dd317b641712d5275e50ddfe5e6a7ba64d05fa4 Mon Sep 17 00:00:00 2001 From: Julian Prieber <60265788+JulianPrieber@users.noreply.github.com> Date: Thu, 10 Nov 2022 19:55:46 +0100 Subject: [PATCH] Update UserController.php --- app/Http/Controllers/UserController.php | 41 ++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 21940f4..8c1c6be 100755 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -215,11 +215,42 @@ class UserController extends Controller if ($OrigLink) { //EDITING EXISTING - $OrigLink->update([ - 'link' => $LinkURL, - 'title' => $LinkTitle, - 'button_id' => $button?->id, - ]); + + $isCustomWebsite = $customParams['GetSiteIcon'] ?? null; + $SpacerHeight = $customParams['height'] ?? null; + + if($linkType->typename == "link" and $isCustomWebsite == "1"){ + $OrigLink->update([ + 'link' => $LinkURL, + 'title' => $LinkTitle, + 'button_id' => "2", + ]); + }elseif($linkType->typename == "link"){ + $OrigLink->update([ + 'link' => $LinkURL, + 'title' => $LinkTitle, + 'button_id' => "1", + ]); + }elseif($linkType->typename == "spacer"){ + $OrigLink->update([ + 'link' => $LinkURL, + 'title' => $LinkTitle, + 'button_id' => "43", + ]); + }elseif($linkType->typename == "heading"){ + $OrigLink->update([ + 'link' => $LinkURL, + 'title' => $LinkTitle, + 'button_id' => "42", + ]); + }else{ + $OrigLink->update([ + 'link' => $LinkURL, + 'title' => $LinkTitle, + 'button_id' => $button?->id, + ]); + } + $message .="updated"; } else { // ADDING NEW