<?php

namespace App\Notifications;

use App\Models\StripeError;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use Laravel\Nova\Notifications\NovaChannel;
use Laravel\Nova\Notifications\NovaNotification;
use Laravel\Nova\URL;

class StripeErrorOccurred extends Notification
{
    use Queueable;
    private StripeError $error;
    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct(StripeError $error )
    {
        $this->error=$error;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['mail', NovaChannel::class];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail($notifiable)
    {
        return (new MailMessage)
                    ->line('One of your user is facing stripe error.')
                    ->action('View Error', url('/admin/resources/stripe-errors'))
                    ->line('Thank you for using our application!');
    }

    public function toNova($notifiable)
    {
        return (new NovaNotification)
            ->message('New Verification requests waiting for your consideration');
    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function toArray($notifiable)
    {
        return [
            //
        ];
    }
}
