<?php

declare(strict_types=1);

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;

class PostCommented extends Notification
{
    use Queueable;

    public function __construct(public string $postId, public string $commenter, public string $excerpt = '')
    {
    }

    public function via(object $notifiable): array
    {
        return ['database'];
    }

    public function toDatabase(object $notifiable): array
    {
        return [
            'type' => 'post_commented',
            'post_id' => $this->postId,
            'commenter' => $this->commenter,
            'excerpt' => $this->excerpt,
            'message' => "내 글에 새 댓글이 달렸습니다",
        ];
    }
}
