@extends('card.layout') @section('title', 'Edit Card — TAPLY') @php $coverGradients = [ 'Teal' => 'linear-gradient(160deg,#14b8a6,#0ea5e9)', 'Violet' => 'linear-gradient(160deg,#7c5cff,#4b2fb8)', 'Indigo' => 'linear-gradient(160deg,#5e6cff,#2a3aa1)', 'Sunset' => 'linear-gradient(160deg,#ff7a59,#c83a1f)', 'Emerald' => 'linear-gradient(160deg,#34d399,#0f766e)', 'Fuchsia' => 'linear-gradient(160deg,#f472b6,#9d174d)', 'Midnight' => 'linear-gradient(160deg,#222,#000)', ]; $coverName = old('cover_name', $profile->cover_name->value); $layout = old('layout', $profile->layout->value); $appearance = old('appearance', $profile->appearance->value); $profilePhotoUrl = $profile->profile_photo_path ? \Illuminate\Support\Facades\Storage::url($profile->profile_photo_path) : null; $companyLogoUrl = $profile->company_logo_path ? \Illuminate\Support\Facades\Storage::url($profile->company_logo_path) : null; $initials = collect(preg_split('/\s+/', trim($profile->full_name))) ->filter()->take(2)->map(fn ($w) => mb_strtoupper(mb_substr($w, 0, 1)))->implode(''); $companyInitials = mb_strtoupper(mb_substr($profile->company_display_name ?: 'CO', 0, 3)); $phonePlaceholders = [ 'linkedin' => 'https://linkedin.com/in/username', 'x' => 'https://x.com/username', 'instagram' => 'https://instagram.com/username', 'facebook' => 'https://facebook.com/username', 'youtube' => 'https://youtube.com/@channel', 'tiktok' => 'https://tiktok.com/@username', 'github' => 'https://github.com/username', 'whatsapp' => 'https://wa.me/15551234567', 'telegram' => 'https://t.me/username', 'snapchat' => 'https://snapchat.com/add/username', 'pinterest' => 'https://pinterest.com/username', 'website' => 'https://yourdomain.com', 'other' => 'https://...', ]; $platformLabels = [ 'linkedin' => 'LinkedIn', 'x' => 'X / Twitter', 'instagram' => 'Instagram', 'facebook' => 'Facebook', 'youtube' => 'YouTube', 'tiktok' => 'TikTok', 'github' => 'GitHub', 'whatsapp' => 'WhatsApp', 'telegram' => 'Telegram', 'snapchat' => 'Snapchat', 'pinterest' => 'Pinterest', 'website' => 'Website', 'other' => 'Other', ]; $platformIcons = [ 'linkedin' => 'bi-linkedin', 'x' => 'bi-twitter-x', 'instagram' => 'bi-instagram', 'facebook' => 'bi-facebook', 'youtube' => 'bi-youtube', 'tiktok' => 'bi-tiktok', 'github' => 'bi-github', 'whatsapp' => 'bi-whatsapp', 'telegram' => 'bi-telegram', 'snapchat' => 'bi-snapchat', 'pinterest' => 'bi-pinterest', 'website' => 'bi-globe2', 'other' => 'bi-link-45deg', ]; $oldPhones = old('phones', $phones->map(fn ($p) => ['label' => $p->label->value, 'number' => $p->number])->all()); $oldEmails = old('emails', $emails->map(fn ($e) => ['label' => $e->label->value, 'address' => $e->address])->all()); $oldSocials = old('socials', $socials->map(fn ($s) => ['platform' => $s->platform->value, 'url' => $s->url])->all()); @endphp @section('body') Cancel {{ $isOwner ? 'Edit Card' : 'Edit · '.$target->name }} Preview @if ($errors->any()) @foreach ($errors->all() as $err) {{ $err }} @endforeach @endif @if (session('status')) {{ session('status') }} @endif @csrf {{-- Hidden carriers for non-input state (selected cover/layout/appearance, image data URLs, clear flags). --}} Profile @if ($profilePhotoUrl) @else {{ $initials ?: 'ME' }} @endif Profile photo PNG or JPG · max 2MB · square works best Remove Change Full name Role Company Company logo @if ($companyLogoUrl) @else {{ $companyInitials }} @endif PNG, JPG or SVG · max 2MB · square works best Remove Upload Bio {{ old('bio', $profile->bio) }} Card cover @foreach ($coverGradients as $name => $gradient) {{ $name }} @endforeach Profile layout Centered Left Magazine Card appearance Dark Light Phone numbers @forelse ($oldPhones as $i => $row) Phone number @foreach ($phoneLabels as $label) {{ $label }} @endforeach @empty @endforelse Add another Phone number @foreach ($phoneLabels as $label) {{ $label }} @endforeach Email addresses @forelse ($oldEmails as $i => $row) Email address @foreach ($emailLabels as $label) {{ $label }} @endforeach @empty @endforelse Add another Email address @foreach ($emailLabels as $label) {{ $label }} @endforeach Quick contact WhatsApp number Website Address Office {{ old('address', $profile->address) }} Social links @forelse ($oldSocials as $i => $row) @php $platform = $row['platform'] ?? 'other'; @endphp @foreach ($socialPlatforms as $p) {{ $platformLabels[$p] ?? ucfirst($p) }} @endforeach @empty @endforelse Add social link @foreach ($socialPlatforms as $p) {{ $platformLabels[$p] ?? ucfirst($p) }} @endforeach Account @php $actor = auth()->user(); @endphp @if ($actor->hasRole(\App\Enums\UserRole::Admin)) Admin dashboard @elseif ($actor->hasRole(\App\Enums\UserRole::Company)) {{ $actor->company?->name ?? 'Company portal' }} @endif Sign out of TAPLY SAVE CHANGES @csrf Cancel Adjust image Done @endsection @push('scripts') @verbatim @endverbatim @endpush