<?php

namespace App\Notifications;

use App\Models\Task;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;

class TaskReminderNotification extends Notification
{
    use Queueable;

    public function __construct(
        protected Task $task,
    ) {}

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

    public function toArray($notifiable): array
    {
        return [
            'type'    => 'task_reminder',
            'title'   => 'Erinnerung: ' . $this->task->title,
            'message' => 'Aufgabe erledigen',
            'task_id' => $this->task->id,
        ];
    }
}
