<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;

class SystemAlertNotification extends Notification implements ShouldQueue
{
    use Queueable;

    protected $message;
    protected $level;

    public function __construct($message, $level = 'info')
    {
        $this->message = $message;
        $this->level = $level;
    }

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

    public function toDatabase($notifiable)
    {
        return [
            'title' => 'System Alert',
            'body' => $this->message,
            'level' => $this->level,
        ];
    }
}
