@extends('layouts.app', ['title' => $contact->exists ? 'Edit '.$contact->full_name : 'Add contact']) @section('content')

{{ $contact->exists ? 'Edit '.$contact->full_name : 'Add contact' }}

An email or a phone number is required.

Back
@if (session('duplicate_id'))
This person is already in your contacts. Open the existing contact
@endif
@csrf @if ($contact->exists) @method('PUT') @endif
Details
@foreach ([ ['first_name', 'First name', 'text', 6], ['last_name', 'Last name', 'text', 6], ['email', 'Email', 'email', 6], ['phone', 'Phone', 'tel', 6], ['company_name', 'Company', 'text', 6], ['job_title', 'Job title', 'text', 6], ['city', 'City', 'text', 4], ['state', 'State', 'text', 4], ['country', 'Country code', 'text', 4], ] as [$name, $label, $type, $col])
@error($name)
{{ $message }}
@enderror
@endforeach
@error('date_of_birth')
{{ $message }}
@enderror
@if ($customFields->isNotEmpty())
Custom fields
@foreach ($customFields as $field) @php($value = old('custom.'.$field->key, $contact->exists ? $contact->customValue($field) : null))
@include('crm.partials.custom-input', ['field' => $field, 'value' => $value, 'name' => 'custom['.$field->key.']']) @error('custom.'.$field->key)
{{ $message }}
@enderror
@endforeach
@endif
Status and owner
dnd_email))>
dnd_whatsapp))>
dnd_sms))>
Tags
@php($selected = collect(old('tag_ids', $contact->exists ? $contact->tags->pluck('id')->all() : []))->map(fn ($id) => (int) $id)) @forelse ($tags as $tag)
contains($tag->id))>
@empty

No tags yet.

@endforelse
Separate with commas.
@endsection