@php
$user = Auth::user();
$laboratory = $user->userslab->map(function($userlab){
return $userlab->labotory;
});
$clientPhoto = null;
$clientResults = null;
if(!empty($laboratory) && isset($laboratory[0])){
$clientResults = DB::select('select photo from clients where lab_id = '. strval($laboratory[0]->id));
if (!empty($clientResults)) {
$client = $clientResults[0];
$clientPhoto = $client->photo;
}
}
@endphp
@if ($clientPhoto)
@php
$photoPath = 'storage/' . strval($clientPhoto);
$fileExists = file_exists(public_path($photoPath));
@endphp
@if ($fileExists)
 }})
@else
 }})
@endif
@else
 }})
@endif