organization->contacts()->findOrFail($contactId); $contact->delete(); session()->flash('status', "Contact \"{$contact->full_name}\" supprimé."); } public function with(): array { return [ 'contacts' => $this->organization->contacts() ->with('location') ->when($this->search, fn ($query) => $query->where(function ($q) { $q->where('first_name', 'like', "%{$this->search}%") ->orWhere('last_name', 'like', "%{$this->search}%") ->orWhere('email', 'like', "%{$this->search}%"); })) ->orderByDesc('is_important') ->orderBy('last_name') ->paginate(15), ]; } }; ?>
{{ $organization->name }}
| Nom | Titre | Téléphone | Site | ||
|---|---|---|---|---|---|
| {{ $contact->full_name }} @if ($contact->is_important) Important @endif | {{ $contact->title ?? '—' }} | {{ $contact->email ?? '—' }} | {{ $contact->phone ?? '—' }} | {{ $contact->location?->name ?? '—' }} | Modifier |
| Aucun contact pour le moment. | |||||