fix/feat: búsqueda móvil, chat solo amigos y bloqueo si se eliminó amistad

- Header: búsqueda móvil con panel deslizable (fixed bajo la topbar), comparte la lógica AJAX con desktop via initSearchWidget()
- ChatController: index muestra solo amigos; show pasa isFriend y friendship a la vista; send valida amistad con abort_unless
- chat/index: muestra amigos con @forelse y mensaje vacío si no tiene
- chat/show: si no son amigos muestra banner de bloqueo con botón contextual (enviar solicitud / cancelar / aceptar según estado)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-28 17:40:16 -06:00
parent e0205ec725
commit f81237b23c
4 changed files with 151 additions and 83 deletions
+14 -6
View File
@@ -9,20 +9,28 @@
<h5 class="mb-0"><i class="fas fa-comments"></i> Chats</h5>
</div>
<div class="card-body p-0" style="overflow-y: auto;">
@foreach($users as $user)
<a href="{{ route('chat.show', $user) }}" class="text-decoration-none">
@forelse($friends as $friend)
<a href="{{ route('chat.show', $friend) }}" class="text-decoration-none">
<div class="d-flex align-items-center p-3 border-bottom chat-user-item">
<img src="{{ $user->profile_photo_url }}"
<img src="{{ $friend->profile_photo_url }}"
class="rounded-circle mr-3"
width="45" height="45"
style="object-fit:cover">
<div>
<div class="font-weight-bold text-dark">{{ $user->name }}</div>
<small class="text-muted">{{ $user->getRoleNames()->first() }}</small>
<div class="font-weight-bold text-dark">{{ $friend->name }}</div>
<small class="text-muted">{{ $friend->getRoleNames()->first() }}</small>
</div>
</div>
</a>
@endforeach
@empty
<div class="text-center text-muted py-5">
<i class="fas fa-user-friends fa-3x mb-3 d-block"></i>
<p class="mb-2">Aún no tienes amigos para chatear.</p>
<a href="{{ route('feed') }}" class="btn btn-primary btn-sm">
<i class="fas fa-search mr-1"></i> Buscar personas
</a>
</div>
@endforelse
</div>
</div>
</div>