mirror of
https://github.com/brufdev/many-notes.git
synced 2026-05-18 08:08:42 -05:00
49 lines
931 B
PHP
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,
|
|
];
|
|
}
|
|
}
|