Files
many-notes/app/Notifications/CollaborationAccepted.php
T
2025-04-03 15:00:53 +01:00

49 lines
931 B
PHP

<?php
declare(strict_types=1);
namespace App\Notifications;
use App\Models\User;
use App\Models\Vault;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
final class CollaborationAccepted extends Notification
{
use Queueable;
/**
* Create a new notification instance.
*/
public function __construct(
private Vault $vault,
private User $user,
) {
//
}
/**
* Get the notification's delivery channels.
*
* @return array<int, string>
*/
public function via(object $notifiable): array
{
return ['database'];
}
/**
* Get the array representation of the notification.
*
* @return array<string, mixed>
*/
public function toArray(object $notifiable): array
{
return [
'vault_id' => $this->vault->id,
'user_id' => $this->user->id,
];
}
}