@if($manager->id)
@else
@endif
{!! $errors->first('password', '
')!!}
{!! $errors->first('password_confirmation', '
')!!}
@php
$userDetail = $manager->userDetail ?? null;
$renderAttachmentPreview = function ($url, $fallbackText) {
if (!$url) {
return '
 . ')
';
}
$extension = strtolower(pathinfo(parse_url($url, PHP_URL_PATH), PATHINFO_EXTENSION));
if (in_array($extension, ['doc', 'docx'])) {
$previewUrl = '/assets/img/docx-icon.jpg';
} elseif ($extension === 'pdf') {
$previewUrl = '/assets/img/pdf-icon.jpg';
} else {
$previewUrl = $url;
}
return '
 . ')
';
};
$logoUrl = old('logo_attachment') ?: ($userDetail->logo_attachment ?? $manager->image ?? null);
@endphp
{!! $renderAttachmentPreview(old('aadhar_card_preview') ?: ($userDetail->aadhar_card ?? null), 'Aadhar Card Attachment') !!}
{!! $errors->first('aadhar_card', '
')!!}
{!! $renderAttachmentPreview(old('gst_attachment_preview') ?: ($userDetail->gst_attachment ?? null), 'GST Attachment') !!}
{!! $errors->first('gst_attachment', '
')!!}
{!! $renderAttachmentPreview(old('pan_card_preview') ?: ($userDetail->pan_card ?? null), 'Pan Card Attachment') !!}
{!! $errors->first('pan_card', '
')!!}
{!! $renderAttachmentPreview($logoUrl, 'Logo Attachment') !!}
{!! $errors->first('logo_attachment', '
')!!}