@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())
@endif @if (session('status'))
{{ session('status') }}
@endif
@csrf {{-- Hidden carriers for non-input state (selected cover/layout/appearance, image data URLs, clear flags). --}}
@if ($profilePhotoUrl) @else {{ $initials ?: 'ME' }} @endif
Profile photo
PNG or JPG · max 2MB · square works best
@if ($companyLogoUrl) @else {{ $companyInitials }} @endif
PNG, JPG or SVG · max 2MB · square works best
@foreach ($coverGradients as $name => $gradient)
{{ $name }}
@endforeach
Centered
Left
Magazine
Dark
Light
@forelse ($oldPhones as $i => $row)
@empty @endforelse
@forelse ($oldEmails as $i => $row)
@empty @endforelse
@php $actor = auth()->user(); @endphp @if ($actor->hasRole(\App\Enums\UserRole::Admin)) @elseif ($actor->hasRole(\App\Enums\UserRole::Company)) @endif
@csrf
@endsection @push('scripts') @verbatim @endverbatim @endpush