Current File : /home/tradevaly/public_html/app/Notifications/User/Subscription/RenewSubscription.php
<?php

namespace App\Notifications\User\Subscription;

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

class RenewSubscription extends Notification
{
    use Queueable;
    public $data;

    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct($data)
    {
        $this->data = $data;
    }

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

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail($notifiable)
    {
        return (new MailMessage)
    ->subject('Renewal Subscription Invoice')
    ->greeting('Hello ' . $this->data->name)
    ->line('Thank you for renewing your subscription with us! 🎉')
    ->line('Below are the details of your renewal subscription invoice:')
    ->line('Invoice Date: ' . now()->toFormattedDateString())
    ->line('Subscription Plan: Premium Membership')
    ->line('Subscription Period: ' . $this->data->start->toFormattedDateString() . ' to ' . $this->data->end->toFormattedDateString())
    ->line('Amount: BDT' . $this->data->amount)
    ->line('Package: ' . $this->data->package)
    ->line('Payment Status: pending')
    ->action('Download Invoice', route('user.subscription.invoice',$this->data->id))
    ->line('Please make the payment to continue enjoying our premium services.')
    ->line('If you have any questions or need assistance, please feel free to reach out to our support team.')
    ->line('Thank you for renewing your subscription with Tradevaly!');
    }

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