@php
$username = $rating->username ?? $rating->no_pembeli ?? 'Guest';
$usernameLength = strlen($username);
if ($usernameLength <= 5) {
$sensorLength = 2;
$start = floor(($usernameLength - $sensorLength) / 2);
$censoredUsername = substr_replace($username, str_repeat('*', $sensorLength), $start, $sensorLength);
} else {
$sensorLength = 4;
$start = floor(($usernameLength - $sensorLength) / 2);
$censoredUsername = substr_replace($username, str_repeat('*', $sensorLength), $start, $sensorLength);
}
@endphp
{{ $censoredUsername }}
@for($i=1; $i<=5; $i++)
@if($i <= $rating->bintang)
@else
@endif
@endfor
|