@extends('layouts.sidebar') @php function findFiles($name){ $directory = base_path('/littlelink/images/'); $files = scandir($directory); $pathinfo = "error.error"; foreach($files as $file) { if (strpos($file, $name.'.') !== false) { $pathinfo = $name. "." . pathinfo($file, PATHINFO_EXTENSION);}} return $pathinfo;} @endphp @section('content')

Edit User

@foreach($user as $user)
@csrf
@if(file_exists(base_path("img/$user->littlelink_name" . ".png" ))) littlelink_name" . ".png") }}" srcset="{{ asset("img/$user->littlelink_name" . "@2x.png 2x") }}" width="128px" height="128px" style="object-fit: cover;"> @elseif(file_exists(base_path("littlelink/images/").findFiles('avatar'))) @else @endif
{{ url('') }}/@
@endforeach
@endsection