From a7d59593c658df57e53d40a441a7f3f16a7d83c5 Mon Sep 17 00:00:00 2001 From: Julian Prieber Date: Fri, 3 Feb 2023 18:00:15 +0100 Subject: [PATCH] Added delete button for profile picture --- resources/views/panel/edit-user.blade.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/views/panel/edit-user.blade.php b/resources/views/panel/edit-user.blade.php index 93f07438..d0c2a804 100755 --- a/resources/views/panel/edit-user.blade.php +++ b/resources/views/panel/edit-user.blade.php @@ -29,17 +29,19 @@
@if(file_exists(base_path("img/" . $user->id . ".png"))) - id . ".png") }}" srcset="{{ asset("img/$user->littlelink_name" . "@2x.png 2x") }}" width="128px" height="128px" style="object-fit: cover;"> + id . ".png") }}" srcset="{{ asset("img/$user->id" . "@2x.png 2x") }}" width="128px" height="128px" style="object-fit: cover;"> @elseif(file_exists(base_path("littlelink/images/").findFile('avatar'))) @else @endif + @if(file_exists(base_path("img/" . $user->id . ".png")))
Delete@endif + @if($_SERVER['QUERY_STRING'] === 'delete' and File::exists(base_path('img/' . $user->id . '.png')))@php File::delete(base_path('img/' . $user->id . '.png')); header("Location: ".url()->current()); die(); @endphp @endif