97c04fbfb4
- Migraciones: posts, post_likes, post_comments - Modelos Post, PostLike, PostComment con relaciones - User: métodos friendshipWith, isFriendWith, friendIds, posts - PostController: feed, crear publicación con imagen, like toggle, comentarios, eliminar - FriendshipController: listar solicitudes, enviar, aceptar, rechazar, toggle AJAX - SocialProfileController: perfil público con publicaciones y estado de amistad - UserSearchController: búsqueda AJAX por nombre con estado de amistad - FriendRequestNotification: notificación al recibir solicitud - Vistas: feed/index, feed/_post, friendships/index, social/profile - Header: barra de búsqueda con autocomplete AJAX (agregar amigo / mensaje) - Menú lateral: Comunidad, Amigos, Mensajes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
691 B
PHP
31 lines
691 B
PHP
<?php
|
|
|
|
namespace App\Notifications;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Notifications\Notification;
|
|
|
|
class FriendRequestNotification extends Notification
|
|
{
|
|
use Queueable;
|
|
|
|
public function __construct(public User $sender) {}
|
|
|
|
public function via(object $notifiable): array
|
|
{
|
|
return ['database'];
|
|
}
|
|
|
|
public function toArray(object $notifiable): array
|
|
{
|
|
return [
|
|
'title' => $this->sender->name . ' te envió una solicitud de amistad',
|
|
'body' => null,
|
|
'url' => route('friendships.index'),
|
|
'icon' => 'fa-user-plus',
|
|
'color' => 'primary',
|
|
];
|
|
}
|
|
}
|