Fixed for current system

This commit is contained in:
Julian Prieber 2023-01-25 17:41:04 +01:00
parent 590f5b45ad
commit 6f6e260f4b
2 changed files with 2 additions and 1 deletions

View File

@ -673,6 +673,7 @@ class UserController extends Controller
public function delProfilePicture() public function delProfilePicture()
{ {
$user_id = Auth::user()->id; $user_id = Auth::user()->id;
$user_id = User::find($user_id)->littlelink_name; // remove when switching to IDs
$path = base_path('img/' . $user_id . '.png'); $path = base_path('img/' . $user_id . '.png');
if (File::exists($path)) { if (File::exists($path)) {

View File

@ -26,7 +26,7 @@
@csrf @csrf
@if($page->littlelink_name != '') @if($page->littlelink_name != '')
<div class="form-group col-lg-8"> <div class="form-group col-lg-8">
<label>Logo</label>@if(file_exists(base_path("img/" . Auth::user()->id . ".png")))<a title="Remove icon" class="hvr-grow p-1 text-danger" style="padding-left:5px;" href="{{ route('delProfilePicture') }}"><i class="bi bi-trash-fill"></i></a>@endif <label>Logo</label>@if(file_exists(base_path("img/" . $page->littlelink_name . ".png")))<a title="Remove icon" class="hvr-grow p-1 text-danger" style="padding-left:5px;" href="{{ route('delProfilePicture') }}"><i class="bi bi-trash-fill"></i></a>@endif
<input type="file" accept="image/jpeg,image/jpg,image/png" class="form-control-file" name="image"> <input type="file" accept="image/jpeg,image/jpg,image/png" class="form-control-file" name="image">
</div> </div>
@endif @endif