Skip to content

Commit fd6b0e1

Browse files
committed
Bugfix
1 parent c1cb69f commit fd6b0e1

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

resources/views/panel/edit-user.blade.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
@extends('layouts.sidebar')
22

3+
@php
4+
function findFiles($name){
5+
$directory = base_path('/littlelink/images/');
6+
$files = scandir($directory);
7+
$pathinfo = "error.error";
8+
foreach($files as $file) {
9+
if (strpos($file, $name.'.') !== false) {
10+
$pathinfo = $name. "." . pathinfo($file, PATHINFO_EXTENSION);}}
11+
return $pathinfo;}
12+
@endphp
13+
314
@section('content')
415

516
<section class="shadow text-gray-400">
@@ -30,8 +41,8 @@
3041
<div class="form-group col-lg-8">
3142
@if(file_exists(base_path("img/$user->littlelink_name" . ".png" )))
3243
<img src="{{ asset("img/$user->littlelink_name" . ".png") }}" srcset="{{ asset("img/$user->littlelink_name" . "@2x.png 2x") }}" width="128px" height="128px" style="object-fit: cover;">
33-
@elseif(file_exists(base_path("littlelink/images/").findFile('avatar')))
34-
<img class="rounded-avatar" src="{{ asset('littlelink/images/'.findFile('avatar')) }}" srcset="{{ asset('littlelink/images/[email protected] 2x') }}" width="128px" height="128px" style="object-fit: cover;">
44+
@elseif(file_exists(base_path("littlelink/images/").findFiles('avatar')))
45+
<img class="rounded-avatar" src="{{ asset('littlelink/images/'.findFiles('avatar')) }}" srcset="{{ asset('littlelink/images/[email protected] 2x') }}" width="128px" height="128px" style="object-fit: cover;">
3546
@else
3647
<img src="{{ asset('littlelink/images/logo.svg') }}" srcset="{{ asset('littlelink/images/[email protected] 2x') }}" width="128px" height="128px" style="object-fit: cover;">
3748
@endif

routes/web.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
Route::post('/studio/page', [UserController::class, 'editPage'])->name('editPage');
119119
Route::get('/studio/profile', [UserController::class, 'showProfile'])->name('showProfile');
120120
Route::post('/studio/profile', [UserController::class, 'editProfile'])->name('editProfile');
121+
Route::post('/edit-icons', [UserController::class, 'editIcons'])->name('editIcons');
121122
Route::get('/studio/delete-user/{id}', [UserController::class, 'deleteUser'])->name('deleteUser')->middleware('verified');
122123
Route::get('/studio/linkparamform_part/{typeid}/{linkid}', [LinkTypeViewController::class, 'getParamForm'])->name('linkparamform.part');
123124
});

0 commit comments

Comments
 (0)