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 }}

Contacts

+ Nouveau contact
@forelse ($contacts as $contact) @empty @endforelse
Nom Titre Email 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.
{{ $contacts->links() }}